From: Luis Chamberlain Date: Fri, 10 Mar 2023 22:58:40 +0000 (-0800) Subject: lockd: simplify two-level sysctl registration for nlm_sysctls X-Git-Tag: v6.6.17~4964^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c1d889cf99b8f9b548f45d0d15b7d4108bbc715f;p=platform%2Fkernel%2Flinux-rpi.git lockd: simplify two-level sysctl registration for nlm_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. Signed-off-by: Luis Chamberlain Reviewed-by: Jeff Layton Signed-off-by: Anna Schumaker --- diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 9a47303..bb94949 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c @@ -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