fs/cachefiles: simplify one-level sysctl registration for cachefiles_sysctls
authorLuis Chamberlain <mcgrof@kernel.org>
Fri, 10 Mar 2023 21:46:23 +0000 (13:46 -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/cachefiles/error_inject.c

index 58f8aec964e4670ec8cd7175a7436ee8dc24bc70..18de8a876b02f671d4259489088ca56bbc0b648d 100644 (file)
@@ -22,18 +22,9 @@ static struct ctl_table cachefiles_sysctls[] = {
        {}
 };
 
-static struct ctl_table cachefiles_sysctls_root[] = {
-       {
-               .procname       = "cachefiles",
-               .mode           = 0555,
-               .child          = cachefiles_sysctls,
-       },
-       {}
-};
-
 int __init cachefiles_register_error_injection(void)
 {
-       cachefiles_sysctl = register_sysctl_table(cachefiles_sysctls_root);
+       cachefiles_sysctl = register_sysctl("cachefiles", cachefiles_sysctls);
        if (!cachefiles_sysctl)
                return -ENOMEM;
        return 0;