All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: dhowells@redhat.com, linux-cachefs@redhat.com, jack@suse.com,
	jaharkes@cs.cmu.edu, coda@cs.cmu.edu, codalist@coda.cs.cmu.edu,
	anton@tuxera.com, linux-ntfs-dev@lists.sourceforge.net
Cc: ebiederm@xmission.com, keescook@chromium.org, yzaikin@google.com,
	j.granados@samsung.com, patches@lists.linux.dev,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH 3/5] quota: simplify two-level sysctl registration for fs_dqstats_table
Date: Fri, 10 Mar 2023 15:12:04 -0800	[thread overview]
Message-ID: <20230310231206.3952808-4-mcgrof@kernel.org> (raw)
In-Reply-To: <20230310231206.3952808-1-mcgrof@kernel.org>

There is no need to declare two tables to just create directories,
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/quota/dquot.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index a6357f728034..90cb70c82012 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -2948,24 +2948,6 @@ static struct ctl_table fs_dqstats_table[] = {
 	{ },
 };
 
-static struct ctl_table fs_table[] = {
-	{
-		.procname	= "quota",
-		.mode		= 0555,
-		.child		= fs_dqstats_table,
-	},
-	{ },
-};
-
-static struct ctl_table sys_table[] = {
-	{
-		.procname	= "fs",
-		.mode		= 0555,
-		.child		= fs_table,
-	},
-	{ },
-};
-
 static int __init dquot_init(void)
 {
 	int i, ret;
@@ -2973,7 +2955,7 @@ static int __init dquot_init(void)
 
 	printk(KERN_NOTICE "VFS: Disk quotas %s\n", __DQUOT_VERSION__);
 
-	register_sysctl_table(sys_table);
+	register_sysctl("fs/quota", fs_dqstats_table);
 
 	dquot_cachep = kmem_cache_create("dquot",
 			sizeof(struct dquot), sizeof(unsigned long) * 4,
-- 
2.39.1


  parent reply	other threads:[~2023-03-10 23:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 23:12 [PATCH 0/5] misc filesystems: simplify sysctl registration Luis Chamberlain
2023-03-10 23:12 ` [PATCH 1/5] fs/cachefiles: simplify one-level sysctl registration for cachefiles_sysctls Luis Chamberlain
2023-03-10 23:12 ` [PATCH 2/5] devpts: simplify two-level sysctl registration for pty_kern_table Luis Chamberlain
2023-03-13 11:38   ` Christian Brauner
2023-03-10 23:12 ` Luis Chamberlain [this message]
2023-03-13 10:32   ` [PATCH 3/5] quota: simplify two-level sysctl registration for fs_dqstats_table Jan Kara
2023-03-10 23:12 ` [PATCH 4/5] coda: simplify one-level sysctl registration for coda_table Luis Chamberlain
2023-03-13 13:21   ` Jan Harkes
2023-03-10 23:12 ` [PATCH 5/5] ntfs: simplfy one-level sysctl registration for ntfs_sysctls Luis Chamberlain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230310231206.3952808-4-mcgrof@kernel.org \
    --to=mcgrof@kernel.org \
    --cc=anton@tuxera.com \
    --cc=coda@cs.cmu.edu \
    --cc=codalist@coda.cs.cmu.edu \
    --cc=dhowells@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=j.granados@samsung.com \
    --cc=jack@suse.com \
    --cc=jaharkes@cs.cmu.edu \
    --cc=keescook@chromium.org \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ntfs-dev@lists.sourceforge.net \
    --cc=patches@lists.linux.dev \
    --cc=yzaikin@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.