summaryrefslogtreecommitdiff
path: root/fs/nfs
diff options
context:
space:
mode:
authorLuis Chamberlain <mcgrof@kernel.org>2023-03-10 00:39:18 -0800
committerLuis Chamberlain <mcgrof@kernel.org>2023-04-13 11:49:35 -0700
commitd2235a705b48a1a86e2b8ea15091d83f7f80503c (patch)
treea8a8bbb2c7cfecc68cb28bcc00800a0187f10c7a /fs/nfs
parent37b768ce3d23f79cef906aaf7427dd345b57f477 (diff)
nfs: simplify two-level sysctl registration for nfs4_cb_sysctls
There is no need to declare two tables to just create directories, this can be easily be done with a prefix path with register_sysctl(). Simplify this registration. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs4sysctl.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/fs/nfs/nfs4sysctl.c b/fs/nfs/nfs4sysctl.c
index c394e4447100..e776200e9a11 100644
--- a/fs/nfs/nfs4sysctl.c
+++ b/fs/nfs/nfs4sysctl.c
@@ -37,27 +37,10 @@ static struct ctl_table nfs4_cb_sysctls[] = {
{ }
};
-static struct ctl_table nfs4_cb_sysctl_dir[] = {
- {
- .procname = "nfs",
- .mode = 0555,
- .child = nfs4_cb_sysctls,
- },
- { }
-};
-
-static struct ctl_table nfs4_cb_sysctl_root[] = {
- {
- .procname = "fs",
- .mode = 0555,
- .child = nfs4_cb_sysctl_dir,
- },
- { }
-};
-
int nfs4_register_sysctl(void)
{
- nfs4_callback_sysctl_table = register_sysctl_table(nfs4_cb_sysctl_root);
+ nfs4_callback_sysctl_table = register_sysctl("fs/nfs",
+ nfs4_cb_sysctls);
if (nfs4_callback_sysctl_table == NULL)
return -ENOMEM;
return 0;