Commit a2183160 authored by Luis Chamberlain's avatar Luis Chamberlain Committed by Anna Schumaker
Browse files

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: default avatarLuis Chamberlain <mcgrof@kernel.org>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent c1d889cf
Loading
Loading
Loading
Loading
+2 −19
Original line number Diff line number Diff line
@@ -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)
{
	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)
		return -ENOMEM;
	return 0;