Skip to content

Commit

Permalink
nfs: simplify two-level sysctl registration for nfs4_cb_sysctls
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Luis Chamberlain <[email protected]>
  • Loading branch information
mcgrof committed Apr 13, 2023
1 parent 37b768c commit d2235a7
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions fs/nfs/nfs4sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d2235a7

Please sign in to comment.