mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Latchesar Ionkov <lucho@ionkov.net>,
	<linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] 9p: Don't use binary sysctl numbers.
Date: Sat, 21 Jul 2007 12:53:19 -0600	[thread overview]
Message-ID: <m1y7h9wpuo.fsf@ebiederm.dsl.xmission.com> (raw)


The recent 9p commit: bd238fb431f31989898423c8b6496bc8c4204a86
that supposedly only moved files also introduced a new 9p sysctl
interface that did not properly register it's sysctl binary numbers,
and since it was only for debugging clearly did not need a binary fast
path in any case.  So this patch just remove the binary numbers.

See Documentation/sysctl/ctl_unnumbered.txt for more details.

While I was at it I cleaned up the sysctl initializers a little as
well so there is less to read.

Cc: Latchesar Ionkov <lucho@ionkov.net>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 net/9p/sysctl.c |   21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/net/9p/sysctl.c b/net/9p/sysctl.c
index e7fe706..8b61027 100644
--- a/net/9p/sysctl.c
+++ b/net/9p/sysctl.c
@@ -28,15 +28,10 @@
 #include <linux/init.h>
 #include <net/9p/9p.h>
 
-enum {
-	P9_SYSCTL_NET = 487,
-	P9_SYSCTL_DEBUG = 1,
-};
-
-static ctl_table p9_table[] = {
+static struct ctl_table p9_table[] = {
 #ifdef CONFIG_NET_9P_DEBUG
 	{
-		.ctl_name       = P9_SYSCTL_DEBUG,
+		.ctl_name       = CTL_UNNUMBERED,
 		.procname       = "debug",
 		.data           = &p9_debug_level,
 		.maxlen         = sizeof(int),
@@ -44,21 +39,21 @@ static ctl_table p9_table[] = {
 		.proc_handler   = &proc_dointvec
 	},
 #endif
-	{	.ctl_name	= 0 },
+	{},
 };
 
-static ctl_table p9_net_table[] = {
+static struct ctl_table p9_net_table[] = {
 	{
-		.ctl_name	= P9_SYSCTL_NET,
+		.ctl_name	= CTL_UNNUMBERED,
 		.procname	= "9p",
 		.maxlen		= 0,
 		.mode		= 0555,
 		.child		= p9_table,
 	},
-	{	.ctl_name	= 0 },
+	{},
 };
 
-static ctl_table p9_ctl_table[] = {
+static struct ctl_table p9_ctl_table[] = {
 	{
 		.ctl_name	= CTL_NET,
 		.procname	= "net",
@@ -66,7 +61,7 @@ static ctl_table p9_ctl_table[] = {
 		.mode		= 0555,
 		.child		= p9_net_table,
 	},
-	{	.ctl_name	= 0 },
+	{},
 };
 
 static struct ctl_table_header *p9_table_header;
-- 
1.5.1.1.181.g2de0


             reply	other threads:[~2007-07-21 18:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-21 18:53 Eric W. Biederman [this message]
2007-07-21 20:57 ` CTL_UNNUMBERED (Re: [PATCH] 9p: Don't use binary sysctl numbers.) Alexey Dobriyan
2007-07-21 21:48   ` Andrew Morton
2007-07-21 22:36   ` Eric W. Biederman
2007-07-23 17:13     ` Eric Van Hensbergen
2007-07-23 18:05       ` Latchesar Ionkov
2007-07-23 18:09         ` Eric Van Hensbergen
2007-07-23 20:37           ` Eric W. Biederman
2007-07-23 20:28     ` Alexey Dobriyan

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=m1y7h9wpuo.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=ericvh@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucho@ionkov.net \
    --cc=torvalds@linux-foundation.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®