From 5cdee3cb0f31d51bca0639e430fbfbe4f53ba6b7 Mon Sep 17 00:00:00 2001 From: Jeffrey Layton Date: Tue, 8 Aug 2023 13:52:32 -0400 Subject: [PATCH] nfs: simplify two-level sysctl registration for nfs4_cb_sysctls JIRA: https://issues.redhat.com/browse/RHEL-7936 commit d2235a705b48a1a86e2b8ea15091d83f7f80503c Author: Luis Chamberlain Date: Fri Mar 10 00:39:18 2023 -0800 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 Signed-off-by: Luis Chamberlain Signed-off-by: Jeffrey Layton --- fs/nfs/nfs4sysctl.c | 21 ++------------------- 1 file 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;