[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230310231206.3952808-6-mcgrof@kernel.org>
Date: Fri, 10 Mar 2023 15:12:06 -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 5/5] ntfs: simplfy one-level sysctl registration for ntfs_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/ntfs/sysctl.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/fs/ntfs/sysctl.c b/fs/ntfs/sysctl.c
index a030d00af90c..174fe536a1c0 100644
--- a/fs/ntfs/sysctl.c
+++ b/fs/ntfs/sysctl.c
@@ -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 {
--
2.39.1
Powered by blists - more mailing lists