[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230310231206.3952808-2-mcgrof@kernel.org>
Date: Fri, 10 Mar 2023 15:12:02 -0800
From: Luis Chamberlain <mcgrof@...nel.org>
To: dhowells@...hat.com, linux-cachefs@...hat.com, jack@...e.com,
jaharkes@...cmu.edu, coda@...cmu.edu, codalist@...a.cs.cmu.edu,
anton@...era.com, linux-ntfs-dev@...ts.sourceforge.net
Cc: ebiederm@...ssion.com, keescook@...omium.org, yzaikin@...gle.com,
j.granados@...sung.com, patches@...ts.linux.dev,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Luis Chamberlain <mcgrof@...nel.org>
Subject: [PATCH 1/5] 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@...nel.org>
---
fs/cachefiles/error_inject.c | 11 +----------
1 file changed, 1 insertion(+), 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;
--
2.39.1
Powered by blists - more mailing lists