Skip to content

Commit

Permalink
lockd: simplify two-level sysctl registration for nlm_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 1dc8689 commit 37b768c
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions fs/lockd/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,24 +510,6 @@ static struct ctl_table nlm_sysctls[] = {
{ }
};

static struct ctl_table nlm_sysctl_dir[] = {
{
.procname = "nfs",
.mode = 0555,
.child = nlm_sysctls,
},
{ }
};

static struct ctl_table nlm_sysctl_root[] = {
{
.procname = "fs",
.mode = 0555,
.child = nlm_sysctl_dir,
},
{ }
};

#endif /* CONFIG_SYSCTL */

/*
Expand Down Expand Up @@ -644,7 +626,7 @@ static int __init init_nlm(void)

#ifdef CONFIG_SYSCTL
err = -ENOMEM;
nlm_sysctl_table = register_sysctl_table(nlm_sysctl_root);
nlm_sysctl_table = register_sysctl("fs/nfs", nlm_sysctls);
if (nlm_sysctl_table == NULL)
goto err_sysctl;
#endif
Expand Down

0 comments on commit 37b768c

Please sign in to comment.