From: Dave Hansen <haveblue@us.ibm.com>
To: Sam Vilain <sam.vilain@catalyst.net.nz>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
linux-kernel@vger.kernel.org,
"Serge E. Hallyn" <serue@us.ibm.com>,
herbert@13thfloor.at, dev@sw.ru, devel@openvz.org,
sam@vilain.net, xemul@sw.ru, Andrew Morton <akpm@osdl.org>,
Cedric Le Goater <clg@fr.ibm.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH 3/3] proc: make UTS-related sysctls utsns aware
Date: Wed, 24 May 2006 11:02:57 -0700 [thread overview]
Message-ID: <1148493777.8658.89.camel@localhost.localdomain> (raw)
In-Reply-To: <20060523012301.13531.12776.stgit@localhost.localdomain>
On Tue, 2006-05-23 at 13:23 +1200, Sam Vilain wrote:
>
> + /* map the filename to the pointer. perhaps it would be
> better
> + to put struct offset pointers in table->data ? */
> + switch (filp->f_dentry->d_name.name[3]) {
> + case 'y': /* ostYpe */
> + which = uts_ns->name.sysname;
> + break;
> + case 't': /* hosTname */
> + which = uts_ns->name.nodename;
> + break;
> + case 'e': /* osrElease */
> + which = uts_ns->name.release;
> + break;
> + case 's': /* verSion */
> + which = uts_ns->name.version;
> + break;
> + case 'x': /* XXX - unreachable */
> + which = uts_ns->name.machine;
> + break;
> + case 'a': /* domAinname */
> + which = uts_ns->name.domainname;
> + break;
> + default:
> + printk("procfs: impossible uts part '%s'",
> + (char*)filp->f_dentry->d_name.name);
> + r = -EINVAL;
> + goto out;
> + }
Why not just switch on the ->ctl_name from the table? Wouldn't that be
easier?
-- Dave
next prev parent reply other threads:[~2006-05-24 18:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-23 1:23 [PATCH 1/3] proc: sysctl: rename proc_doutsstring to proc_do_uts_string Sam Vilain
2006-05-23 1:23 ` [PATCH 2/3] proc: sysctl: add _proc_do_string helper Sam Vilain
2006-05-23 1:23 ` [PATCH 3/3] proc: make UTS-related sysctls utsns aware Sam Vilain
2006-05-24 15:54 ` Andrew Morton
2006-05-25 3:51 ` Sam Vilain
2006-05-24 18:02 ` Dave Hansen [this message]
2006-05-25 4:01 ` Sam Vilain
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=1148493777.8658.89.camel@localhost.localdomain \
--to=haveblue@us.ibm.com \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=clg@fr.ibm.com \
--cc=dev@sw.ru \
--cc=devel@openvz.org \
--cc=ebiederm@xmission.com \
--cc=herbert@13thfloor.at \
--cc=linux-kernel@vger.kernel.org \
--cc=sam.vilain@catalyst.net.nz \
--cc=sam@vilain.net \
--cc=serue@us.ibm.com \
--cc=xemul@sw.ru \
/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