ntfs: simplfy one-level sysctl registration for ntfs_sysctls
authorLuis Chamberlain <mcgrof@kernel.org>
Fri, 10 Mar 2023 21:49:40 +0000 (13:49 -0800)
committerLuis Chamberlain <mcgrof@kernel.org>
Thu, 13 Apr 2023 18:49:35 +0000 (11:49 -0700)
There is no need to declare an extra tables to just create directory,
this can be easily be done with a prefix path with register_sysctl().

Simplify this registration.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
fs/ntfs/sysctl.c

index a030d00af90c4a25fd9b9e85fde321f36c708f2f..174fe536a1c05d2da4b417bca062839fb3041f09 100644 (file)
@@ -31,16 +31,6 @@ static struct ctl_table ntfs_sysctls[] = {
        {}
 };
 
-/* Define the parent directory /proc/sys/fs. */
-static struct ctl_table sysctls_root[] = {
-       {
-               .procname       = "fs",
-               .mode           = 0555,
-               .child          = ntfs_sysctls
-       },
-       {}
-};
-
 /* Storage for the sysctls header. */
 static struct ctl_table_header *sysctls_root_table;
 
@@ -54,7 +44,7 @@ int ntfs_sysctl(int add)
 {
        if (add) {
                BUG_ON(sysctls_root_table);
-               sysctls_root_table = register_sysctl_table(sysctls_root);
+               sysctls_root_table = register_sysctl("fs", ntfs_sysctls);
                if (!sysctls_root_table)
                        return -ENOMEM;
        } else {