fs: move namespace sysctls and declare fs base directory
authorLuis Chamberlain <mcgrof@kernel.org>
Thu, 30 Dec 2021 09:29:44 +0000 (20:29 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 18 Jan 2022 01:50:14 +0000 (12:50 +1100)
commitf45a17ed4ce8cedeee014a3d41c59eca35b1fdd6
treefef0041a4b98c5a88fa674b5e7efd248f23a696e
parentbc53e60a58fd3732f2b70d37f2441a3b37755480
fs: move namespace sysctls and declare fs base directory

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/20211129211943.640266-3-mcgrof@kernel.org
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: Antti Palosaari <crope@iki.fi>
Cc: Christian Brauner <christian.brauner@ubuntu.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Eric Biggers <ebiggers@google.com>
Cc: Iurii Zaikin <yzaikin@google.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Lukas Middendorf <kernel@tuxforce.de>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: "Naveen N. Rao" <naveen.n.rao@linux.ibm.com>
Cc: Stephen Kitt <steve@sk2.org>
Cc: Xiaoming Ni <nixiaoming@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
fs/Makefile
fs/namespace.c
fs/sysctls.c
include/linux/mount.h
kernel/sysctl.c