vfs: opencode mntget() mnt_set_mountpoint()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 25 Nov 2011 08:19:09 +0000 (03:19 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 4 Jan 2012 03:57:12 +0000 (22:57 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namespace.c

index 24e8456..cd63893 100644 (file)
@@ -572,8 +572,9 @@ static void detach_mnt(struct mount *mnt, struct path *old_path)
 void mnt_set_mountpoint(struct mount *mnt, struct dentry *dentry,
                        struct mount *child_mnt)
 {
-       child_mnt->mnt_parent = real_mount(mntget(&mnt->mnt));
+       mnt_add_count(mnt, 1);  /* essentially, that's mntget */
        child_mnt->mnt_mountpoint = dget(dentry);
+       child_mnt->mnt_parent = mnt;
        spin_lock(&dentry->d_lock);
        dentry->d_flags |= DCACHE_MOUNTED;
        spin_unlock(&dentry->d_lock);