Commit f5d2b92c authored by Luis Chamberlain's avatar Luis Chamberlain
Browse files

xfs: simplify two-level sysctl registration for xfs_table



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: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
parent a2189b77
Loading
Loading
Loading
Loading
+1 −19
Original line number Diff line number Diff line
@@ -210,28 +210,10 @@ static struct ctl_table xfs_table[] = {
	{}
};

static struct ctl_table xfs_dir_table[] = {
	{
		.procname	= "xfs",
		.mode		= 0555,
		.child		= xfs_table
	},
	{}
};

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

int
xfs_sysctl_register(void)
{
	xfs_table_header = register_sysctl_table(xfs_root_table);
	xfs_table_header = register_sysctl("fs/xfs", xfs_table);
	if (!xfs_table_header)
		return -ENOMEM;
	return 0;