Skip to content

Commit

Permalink
xfs: simplify two-level sysctl registration for xfs_table
Browse files Browse the repository at this point in the history
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: Dave Chinner <[email protected]>
Signed-off-by: Luis Chamberlain <[email protected]>
  • Loading branch information
mcgrof committed Apr 13, 2023
1 parent a2189b7 commit f5d2b92
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions fs/xfs/xfs_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f5d2b92

Please sign in to comment.