mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
lockd: simplify two-level sysctl registration for nlm_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. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
This commit is contained in:
parent
1dc8689e4c
commit
37b768ce3d
1 changed files with 1 additions and 19 deletions
|
@ -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 */
|
#endif /* CONFIG_SYSCTL */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -644,7 +626,7 @@ static int __init init_nlm(void)
|
||||||
|
|
||||||
#ifdef CONFIG_SYSCTL
|
#ifdef CONFIG_SYSCTL
|
||||||
err = -ENOMEM;
|
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)
|
if (nlm_sysctl_table == NULL)
|
||||||
goto err_sysctl;
|
goto err_sysctl;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue