xfs: simplify two-level sysctl registration for xfs_table
authorLuis Chamberlain <mcgrof@kernel.org>
Fri, 10 Mar 2023 08:42:26 +0000 (00:42 -0800)
committerLuis Chamberlain <mcgrof@kernel.org>
Thu, 13 Apr 2023 18:49:35 +0000 (11:49 -0700)
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 <dchinner@redhat.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
fs/xfs/xfs_sysctl.c

index 546a6cd9672924dfed520bc7feb2df47f4dbfabc..fade337353931663ec17ff72a47d74b9053c901c 100644 (file)
@@ -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;