Skip to content

Commit a218316

Browse files
mcgrofamschuma-ntap
authored andcommitted
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. 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 c1d889c commit a218316

1 file changed

Lines changed: 2 additions & 19 deletions

File tree

fs/nfs/nfs4sysctl.c

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,10 @@ static struct ctl_table nfs4_cb_sysctls[] = {
3737
{ }
3838
};
3939

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-
5840
int nfs4_register_sysctl(void)
5941
{
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);
6144
if (nfs4_callback_sysctl_table == NULL)
6245
return -ENOMEM;
6346
return 0;

0 commit comments

Comments
 (0)