summaryrefslogtreecommitdiffstats
path: root/fs/cachefiles
diff options
context:
space:
mode:
authorLuis Chamberlain <mcgrof@kernel.org>2023-03-10 13:46:23 -0800
committerLuis Chamberlain <mcgrof@kernel.org>2023-04-13 11:49:35 -0700
commit3d379b8d0de0492e86b93a1b8cd07403825fe23d (patch)
treeb3477ef43fefd717f79c8696de6639219f49da46 /fs/cachefiles
parentf5d2b92c85d420d0020163b9ad153962d8f9fcc7 (diff)
downloadlinux-3d379b8d0de0492e86b93a1b8cd07403825fe23d.tar.gz
linux-3d379b8d0de0492e86b93a1b8cd07403825fe23d.tar.bz2
linux-3d379b8d0de0492e86b93a1b8cd07403825fe23d.zip
fs/cachefiles: simplify one-level sysctl registration for cachefiles_sysctls
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>
Diffstat (limited to 'fs/cachefiles')
-rw-r--r--fs/cachefiles/error_inject.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/fs/cachefiles/error_inject.c b/fs/cachefiles/error_inject.c
index 58f8aec964e4..18de8a876b02 100644
--- a/fs/cachefiles/error_inject.c
+++ b/fs/cachefiles/error_inject.c
@@ -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;