Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e080e436f605877e47e4950f5386ed843badbb1b
Commit:     e080e436f605877e47e4950f5386ed843badbb1b
Parent:     2c19c49a59ccf2162c0eb999de1ec60c0e07a533
Author:     Tejun Heo <[EMAIL PROTECTED]>
AuthorDate: Wed Jul 18 14:29:06 2007 +0900
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Wed Jul 18 15:49:49 2007 -0700

    sysfs: fix sysfs root inode nlink accounting
    
    While making sysfs indoes hashed, sysfs root inode was left out.  Now
    that nlink accounting depends on the inode being on the hash, sysfs
    root inode nlink isn't adjusted properly.
    
    Put sysfs root inode on the inode hash by allocating it using
    sysfs_get_inode() like other sysfs inodes.  While at it, massage
    comments a bit.
    
    Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
    Acked-by: Jean Delvare <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/mount.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
index 402cc35..60714d0 100644
--- a/fs/sysfs/mount.c
+++ b/fs/sysfs/mount.c
@@ -43,19 +43,19 @@ static int sysfs_fill_super(struct super_block *sb, void 
*data, int silent)
        sb->s_time_gran = 1;
        sysfs_sb = sb;
 
-       inode = new_inode(sysfs_sb);
+       /* get root inode, initialize and unlock it */
+       inode = sysfs_get_inode(&sysfs_root);
        if (!inode) {
                pr_debug("sysfs: could not get root inode\n");
                return -ENOMEM;
        }
 
-       sysfs_init_inode(&sysfs_root, inode);
-
        inode->i_op = &sysfs_dir_inode_operations;
        inode->i_fop = &sysfs_dir_operations;
-       /* directory inodes start off with i_nlink == 2 (for "." entry) */
-       inc_nlink(inode);
+       inc_nlink(inode); /* directory, account for "." */
+       unlock_new_inode(inode);
 
+       /* instantiate and link root dentry */
        root = d_alloc_root(inode);
        if (!root) {
                pr_debug("%s: could not get root dentry!\n",__FUNCTION__);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to