]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
lockd: simplify two-level sysctl registration for nlm_sysctls
authorLuis Chamberlain <mcgrof@kernel.org>
Fri, 10 Mar 2023 08:37:19 +0000 (00:37 -0800)
committerLuis Chamberlain <mcgrof@kernel.org>
Thu, 13 Apr 2023 18:49:35 +0000 (11:49 -0700)
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>
fs/lockd/svc.c

index 9a47303b2cba6eae17098d8ce472b58ddb6b0f3b..bb94949bc2235d6fc4a8654b3f071ad4a9b13528 100644 (file)
@@ -510,24 +510,6 @@ static struct ctl_table nlm_sysctls[] = {
        { }
 };
 
-static struct ctl_table nlm_sysctl_dir[] = {
-       {
-               .procname       = "nfs",
-               .mode           = 0555,
-               .child          = nlm_sysctls,
-       },
-       { }
-};
-
-static struct ctl_table nlm_sysctl_root[] = {
-       {
-               .procname       = "fs",
-               .mode           = 0555,
-               .child          = nlm_sysctl_dir,
-       },
-       { }
-};
-
 #endif /* CONFIG_SYSCTL */
 
 /*
@@ -644,7 +626,7 @@ static int __init init_nlm(void)
 
 #ifdef CONFIG_SYSCTL
        err = -ENOMEM;
-       nlm_sysctl_table = register_sysctl_table(nlm_sysctl_root);
+       nlm_sysctl_table = register_sysctl("fs/nfs", nlm_sysctls);
        if (nlm_sysctl_table == NULL)
                goto err_sysctl;
 #endif