Get rid of mnt_mountpoint abuses in ext4
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 24 Jan 2010 01:10:29 +0000 (20:10 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 3 Mar 2010 19:07:54 +0000 (14:07 -0500)
path to mnt/mnt->mnt_root is no worse than that to
mnt->mnt_parent/mnt->mnt_mountpoint *and* needs no
pinning the sucker down (mnt is not going away and
mnt->mnt_root won't change)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ext4/file.c

index 9630583..56eee3d 100644 (file)
@@ -116,11 +116,9 @@ static int ext4_file_open(struct inode * inode, struct file * filp)
                 * devices or filesystem images.
                 */
                memset(buf, 0, sizeof(buf));
-               path.mnt = mnt->mnt_parent;
-               path.dentry = mnt->mnt_mountpoint;
-               path_get(&path);
+               path.mnt = mnt;
+               path.dentry = mnt->mnt_root;
                cp = d_path(&path, buf, sizeof(buf));
-               path_put(&path);
                if (!IS_ERR(cp)) {
                        memcpy(sbi->s_es->s_last_mounted, cp,
                               sizeof(sbi->s_es->s_last_mounted));