Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -19
+2 -19
fs/nfs/nfs4sysctl.c
··· 37 37 { } 38 38 }; 39 39 40 - static struct ctl_table nfs4_cb_sysctl_dir[] = { 41 - { 42 - .procname = "nfs", 43 - .mode = 0555, 44 - .child = nfs4_cb_sysctls, 45 - }, 46 - { } 47 - }; 48 - 49 - static struct ctl_table nfs4_cb_sysctl_root[] = { 50 - { 51 - .procname = "fs", 52 - .mode = 0555, 53 - .child = nfs4_cb_sysctl_dir, 54 - }, 55 - { } 56 - }; 57 - 58 40 int nfs4_register_sysctl(void) 59 41 { 60 - nfs4_callback_sysctl_table = register_sysctl_table(nfs4_cb_sysctl_root); 42 + nfs4_callback_sysctl_table = register_sysctl("fs/nfs", 43 + nfs4_cb_sysctls); 61 44 if (nfs4_callback_sysctl_table == NULL) 62 45 return -ENOMEM; 63 46 return 0;