aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis Chamberlain <mcgrof@kernel.org>2021-11-17 15:42:45 -0800
committerLuis Chamberlain <mcgrof@kernel.org>2021-11-17 15:50:59 -0800
commit2acfd364b61533c1fd9e7a9ebf90d63e80435ce4 (patch)
treeb1b6dadacae879ef62bba2ff44163288367472ab
parente727f07ea75eda3892a29abc81b503ebc2bbcaf1 (diff)
downloadlinux-next-2acfd364b61533c1fd9e7a9ebf90d63e80435ce4.tar.gz
fs: move binfmt_misc sysctl to its own file
This moves the binfmt_misc sysctl to its own file to help remove clutter from kernel/sysctl.c. Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
-rw-r--r--fs/binfmt_misc.c6
-rw-r--r--kernel/sysctl.c7
2 files changed, 5 insertions, 8 deletions
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index e1eae7ea823ae..be18bc44bca65 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -822,7 +822,11 @@ static int __init init_misc_binfmt(void)
int err = register_filesystem(&bm_fs_type);
if (!err)
insert_binfmt(&misc_format);
- return err;
+ if (!register_sysctl_mount_point("fs/binfmt_misc")) {
+ panic("Failed to create fs/binfmt_misc sysctl mount point");
+ return -ENOMEM;
+ }
+ return 0;
}
static void __exit exit_misc_binfmt(void)
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index fde45c6b6d940..48c6cf9b0b05f 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -3126,13 +3126,6 @@ static struct ctl_table fs_table[] = {
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_TWO,
},
-#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
- {
- .procname = "binfmt_misc",
- .mode = 0555,
- .child = sysctl_mount_point,
- },
-#endif
{
.procname = "pipe-max-size",
.data = &pipe_max_size,