lkml.org 
[lkml]   [2007]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectAbout mounting the sysfs
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


\
 
 \ /
  Last update: 2007-12-18 08:13    [W:0.051 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site