diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-11-25 00:30:56 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-03 22:57:09 -0500 |
commit | 95bc5f25c10fcdf02c53af1eda987f58d0bc377c (patch) | |
tree | 2219763ee8543e8c9a492796771bf0e8cbe44df0 /fs/namespace.c | |
parent | 6776db3d32b2a59198ec7ac6d32be0b9fdbd8a68 (diff) |
vfs: spread struct mount - do_add_mount and graft_tree
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r-- | fs/namespace.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index a14750be7a70..6b5e0436acfd 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -1666,19 +1666,19 @@ static void unlock_mount(struct path *path) | |||
1666 | mutex_unlock(&path->dentry->d_inode->i_mutex); | 1666 | mutex_unlock(&path->dentry->d_inode->i_mutex); |
1667 | } | 1667 | } |
1668 | 1668 | ||
1669 | static int graft_tree(struct vfsmount *mnt, struct path *path) | 1669 | static int graft_tree(struct mount *mnt, struct path *path) |
1670 | { | 1670 | { |
1671 | if (mnt->mnt_sb->s_flags & MS_NOUSER) | 1671 | if (mnt->mnt.mnt_sb->s_flags & MS_NOUSER) |
1672 | return -EINVAL; | 1672 | return -EINVAL; |
1673 | 1673 | ||
1674 | if (S_ISDIR(path->dentry->d_inode->i_mode) != | 1674 | if (S_ISDIR(path->dentry->d_inode->i_mode) != |
1675 | S_ISDIR(mnt->mnt_root->d_inode->i_mode)) | 1675 | S_ISDIR(mnt->mnt.mnt_root->d_inode->i_mode)) |
1676 | return -ENOTDIR; | 1676 | return -ENOTDIR; |
1677 | 1677 | ||
1678 | if (d_unlinked(path->dentry)) | 1678 | if (d_unlinked(path->dentry)) |
1679 | return -ENOENT; | 1679 | return -ENOENT; |
1680 | 1680 | ||
1681 | return attach_recursive_mnt(real_mount(mnt), path, NULL); | 1681 | return attach_recursive_mnt(mnt, path, NULL); |
1682 | } | 1682 | } |
1683 | 1683 | ||
1684 | /* | 1684 | /* |
@@ -1776,7 +1776,7 @@ static int do_loopback(struct path *path, char *old_name, | |||
1776 | if (!mnt) | 1776 | if (!mnt) |
1777 | goto out2; | 1777 | goto out2; |
1778 | 1778 | ||
1779 | err = graft_tree(&mnt->mnt, path); | 1779 | err = graft_tree(mnt, path); |
1780 | if (err) { | 1780 | if (err) { |
1781 | br_write_lock(vfsmount_lock); | 1781 | br_write_lock(vfsmount_lock); |
1782 | umount_tree(mnt, 0, &umount_list); | 1782 | umount_tree(mnt, 0, &umount_list); |
@@ -1972,7 +1972,7 @@ do_kern_mount(const char *fstype, int flags, const char *name, void *data) | |||
1972 | /* | 1972 | /* |
1973 | * add a mount into a namespace's mount tree | 1973 | * add a mount into a namespace's mount tree |
1974 | */ | 1974 | */ |
1975 | static int do_add_mount(struct vfsmount *newmnt, struct path *path, int mnt_flags) | 1975 | static int do_add_mount(struct mount *newmnt, struct path *path, int mnt_flags) |
1976 | { | 1976 | { |
1977 | int err; | 1977 | int err; |
1978 | 1978 | ||
@@ -1988,15 +1988,15 @@ static int do_add_mount(struct vfsmount *newmnt, struct path *path, int mnt_flag | |||
1988 | 1988 | ||
1989 | /* Refuse the same filesystem on the same mount point */ | 1989 | /* Refuse the same filesystem on the same mount point */ |
1990 | err = -EBUSY; | 1990 | err = -EBUSY; |
1991 | if (path->mnt->mnt_sb == newmnt->mnt_sb && | 1991 | if (path->mnt->mnt_sb == newmnt->mnt.mnt_sb && |
1992 | path->mnt->mnt_root == path->dentry) | 1992 | path->mnt->mnt_root == path->dentry) |
1993 | goto unlock; | 1993 | goto unlock; |
1994 | 1994 | ||
1995 | err = -EINVAL; | 1995 | err = -EINVAL; |
1996 | if (S_ISLNK(newmnt->mnt_root->d_inode->i_mode)) | 1996 | if (S_ISLNK(newmnt->mnt.mnt_root->d_inode->i_mode)) |
1997 | goto unlock; | 1997 | goto unlock; |
1998 | 1998 | ||
1999 | newmnt->mnt_flags = mnt_flags; | 1999 | newmnt->mnt.mnt_flags = mnt_flags; |
2000 | err = graft_tree(newmnt, path); | 2000 | err = graft_tree(newmnt, path); |
2001 | 2001 | ||
2002 | unlock: | 2002 | unlock: |
@@ -2025,7 +2025,7 @@ static int do_new_mount(struct path *path, char *type, int flags, | |||
2025 | if (IS_ERR(mnt)) | 2025 | if (IS_ERR(mnt)) |
2026 | return PTR_ERR(mnt); | 2026 | return PTR_ERR(mnt); |
2027 | 2027 | ||
2028 | err = do_add_mount(mnt, path, mnt_flags); | 2028 | err = do_add_mount(real_mount(mnt), path, mnt_flags); |
2029 | if (err) | 2029 | if (err) |
2030 | mntput(mnt); | 2030 | mntput(mnt); |
2031 | return err; | 2031 | return err; |
@@ -2046,7 +2046,7 @@ int finish_automount(struct vfsmount *m, struct path *path) | |||
2046 | goto fail; | 2046 | goto fail; |
2047 | } | 2047 | } |
2048 | 2048 | ||
2049 | err = do_add_mount(m, path, path->mnt->mnt_flags | MNT_SHRINKABLE); | 2049 | err = do_add_mount(mnt, path, path->mnt->mnt_flags | MNT_SHRINKABLE); |
2050 | if (!err) | 2050 | if (!err) |
2051 | return 0; | 2051 | return 0; |
2052 | fail: | 2052 | fail: |