From: "Randy.Dunlap" <rddunlap@osdl.org>
To: John Richard Moser <nigelenki@comcast.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: /proc parent &proc_root == NULL?
Date: Wed, 26 Jan 2005 17:25:39 -0800 [thread overview]
Message-ID: <41F84313.4030509@osdl.org> (raw)
In-Reply-To: <41F82218.1080705@comcast.net>
John Richard Moser wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> proc_misc_init() has both these lines in it:
>
> entry = create_proc_entry("kmsg", S_IRUSR, &proc_root);
> proc_root_kcore = create_proc_entry("kcore", S_IRUSR, NULL);
>
> Both entries show up in /proc, as /proc/kmsg and /proc/kcore. So I ask,
> as I can't see after several minutes of examination, what's the
> difference? Why is NULL used for some and &proc_root used for others?
>
> I'm looking at 2.6.10
create_proc_entry() passes &parent to proc_create().
See proc_create():
...
This is an error path:
if (!(*parent) && xlate_proc_name(name, parent, &fn) != 0)
goto out;
but xlate_proc_name() searches for a /proc/.... and returns the
all-but-final-part-of-name *parent (hope that makes some sense,
see the comments above the function), so it returns &proc_root.
HTH. If not, fire back.
--
~Randy
next prev parent reply other threads:[~2005-01-27 1:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-26 23:04 /proc parent &proc_root == NULL? John Richard Moser
2005-01-27 1:25 ` Randy.Dunlap [this message]
2005-01-27 2:33 ` John Richard Moser
2005-01-27 3:15 ` Al Viro
2005-01-27 3:35 ` John Richard Moser
2005-01-27 6:40 ` Valdis.Kletnieks
2005-01-27 6:51 ` John Richard Moser
2005-01-27 7:10 ` Valdis.Kletnieks
2005-01-27 7:43 ` John Richard Moser
2005-01-27 6:53 ` Valdis.Kletnieks
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=41F84313.4030509@osdl.org \
--to=rddunlap@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nigelenki@comcast.net \
/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