mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
This moves the namespace sysctls to its own file as part of the kernel/sysctl.c spring cleaning Since we have now removed all sysctls for "fs", we now have to declare it on the filesystem code, we do that using the new helper, which reduces boiler plate code. We rename init_fs_shared_sysctls() to init_fs_sysctls() to reflect that now fs/sysctls.c is taking on the burden of being the first to register the base directory as well. Lastly, since init code will load in the order in which we link it we have to move the sysctl code to be linked in early, so that its early init routine runs prior to other fs code. This way, other filesystem code can register their own sysctls using the helpers after this: * register_sysctl_init() * register_sysctl() Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Luis Chamberlain <[email protected]> Cc: Al Viro <[email protected]> Cc: Anil S Keshavamurthy <[email protected]> Cc: Antti Palosaari <[email protected]> Cc: Christian Brauner <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Eric Biederman <[email protected]> Cc: Eric Biggers <[email protected]> Cc: Iurii Zaikin <[email protected]> Cc: Kees Cook <[email protected]> Cc: Lukas Middendorf <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: "Naveen N. Rao" <[email protected]> Cc: Stephen Kitt <[email protected]> Cc: Xiaoming Ni <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
40 lines
809 B
C
40 lines
809 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* /proc/sys/fs shared sysctls
|
|
*
|
|
* These sysctls are shared between different filesystems.
|
|
*/
|
|
#include <linux/init.h>
|
|
#include <linux/sysctl.h>
|
|
|
|
static struct ctl_table fs_shared_sysctls[] = {
|
|
{
|
|
.procname = "overflowuid",
|
|
.data = &fs_overflowuid,
|
|
.maxlen = sizeof(int),
|
|
.mode = 0644,
|
|
.proc_handler = proc_dointvec_minmax,
|
|
.extra1 = SYSCTL_ZERO,
|
|
.extra2 = SYSCTL_MAXOLDUID,
|
|
},
|
|
{
|
|
.procname = "overflowgid",
|
|
.data = &fs_overflowgid,
|
|
.maxlen = sizeof(int),
|
|
.mode = 0644,
|
|
.proc_handler = proc_dointvec_minmax,
|
|
.extra1 = SYSCTL_ZERO,
|
|
.extra2 = SYSCTL_MAXOLDUID,
|
|
},
|
|
{ }
|
|
};
|
|
|
|
DECLARE_SYSCTL_BASE(fs, fs_shared_sysctls);
|
|
|
|
static int __init init_fs_sysctls(void)
|
|
{
|
|
return register_sysctl_base(fs);
|
|
}
|
|
|
|
early_initcall(init_fs_sysctls);
|