Skip to content

Commit 3972421

Browse files
mcgrofamschuma-ntap
authored andcommitted
nfs: simplify two-level sysctl registration for nfs_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. Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent a218316 commit 3972421

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

fs/nfs/sysctl.c

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,9 @@ static struct ctl_table nfs_cb_sysctls[] = {
3232
{ }
3333
};
3434

35-
static struct ctl_table nfs_cb_sysctl_dir[] = {
36-
{
37-
.procname = "nfs",
38-
.mode = 0555,
39-
.child = nfs_cb_sysctls,
40-
},
41-
{ }
42-
};
43-
44-
static struct ctl_table nfs_cb_sysctl_root[] = {
45-
{
46-
.procname = "fs",
47-
.mode = 0555,
48-
.child = nfs_cb_sysctl_dir,
49-
},
50-
{ }
51-
};
52-
5335
int nfs_register_sysctl(void)
5436
{
55-
nfs_callback_sysctl_table = register_sysctl_table(nfs_cb_sysctl_root);
37+
nfs_callback_sysctl_table = register_sysctl("fs/nfs", nfs_cb_sysctls);
5638
if (nfs_callback_sysctl_table == NULL)
5739
return -ENOMEM;
5840
return 0;

0 commit comments

Comments
 (0)