mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 16:49:22 +00:00
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>
This commit is contained in:
parent
c1d889cf99
commit
a2183160ca
1 changed files with 2 additions and 19 deletions
|
@ -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)
|
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)
|
if (nfs4_callback_sysctl_table == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue