mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
nfs: simplify two-level sysctl registration for nfs_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. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
This commit is contained in:
@@ -32,27 +32,9 @@ static struct ctl_table nfs_cb_sysctls[] = {
|
|||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct ctl_table nfs_cb_sysctl_dir[] = {
|
|
||||||
{
|
|
||||||
.procname = "nfs",
|
|
||||||
.mode = 0555,
|
|
||||||
.child = nfs_cb_sysctls,
|
|
||||||
},
|
|
||||||
{ }
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct ctl_table nfs_cb_sysctl_root[] = {
|
|
||||||
{
|
|
||||||
.procname = "fs",
|
|
||||||
.mode = 0555,
|
|
||||||
.child = nfs_cb_sysctl_dir,
|
|
||||||
},
|
|
||||||
{ }
|
|
||||||
};
|
|
||||||
|
|
||||||
int nfs_register_sysctl(void)
|
int nfs_register_sysctl(void)
|
||||||
{
|
{
|
||||||
nfs_callback_sysctl_table = register_sysctl_table(nfs_cb_sysctl_root);
|
nfs_callback_sysctl_table = register_sysctl("fs/nfs", nfs_cb_sysctls);
|
||||||
if (nfs_callback_sysctl_table == NULL)
|
if (nfs_callback_sysctl_table == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user