From: wit <is01kzh@gmail.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: About mounting the sysfs
Date: Tue, 18 Dec 2007 15:10:50 +0800 [thread overview]
Message-ID: <105610bf0712172310ob56ae9ch4fa63e132011ae18@mail.gmail.com> (raw)
Hi all,
Currently, I'm studying the code of the sysfs. But I got the
following questions:
1. What is the d_alloc_root used for? Actually, the question should
be: why we have to call d_alloc_root. I think the root already has its
dentry, why we have to allocate another while we mounting a file
system?
2. Why we call d_alloc_root to allocate a dentry for the mount point
while the usual mount point of sysfs is defined by the user (something
like /sysfs but not /). See below:
root = d_alloc_root(inode);
if (!root) {
pr_debug("%s: could not get root dentry!\n",__FUNCTION__);
iput(inode);
return -ENOMEM;
}
root->d_fsdata = &sysfs_root;
sb->s_root = root;
does this means settting the sysfs' mount point to "/" but not "/sysfs".
Thanks.
--Zhanhua
next reply other threads:[~2007-12-18 7:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-18 7:10 wit [this message]
2007-12-18 12:39 ` Jan Engelhardt
2007-12-18 15:05 ` Zhanhua
-- strict thread matches above, loose matches on Subject: below --
2007-12-05 15:02 about " wit
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=105610bf0712172310ob56ae9ch4fa63e132011ae18@mail.gmail.com \
--to=is01kzh@gmail.com \
--cc=linux-kernel@vger.kernel.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®