Commit 8d66bf5481002b0960aa49aed0987c73f5d7816c
1 parent
d5686b444f
Exists in
master
and in
4 other branches
[PATCH] pass struct path * to do_add_mount()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 5 changed files with 13 additions and 12 deletions Side-by-side Diff
fs/afs/mntpt.c
fs/cifs/cifs_dfs_ref.c
fs/namespace.c
... | ... | @@ -1667,31 +1667,31 @@ |
1667 | 1667 | if (IS_ERR(mnt)) |
1668 | 1668 | return PTR_ERR(mnt); |
1669 | 1669 | |
1670 | - return do_add_mount(mnt, nd, mnt_flags, NULL); | |
1670 | + return do_add_mount(mnt, &nd->path, mnt_flags, NULL); | |
1671 | 1671 | } |
1672 | 1672 | |
1673 | 1673 | /* |
1674 | 1674 | * add a mount into a namespace's mount tree |
1675 | 1675 | * - provide the option of adding the new mount to an expiration list |
1676 | 1676 | */ |
1677 | -int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd, | |
1677 | +int do_add_mount(struct vfsmount *newmnt, struct path *path, | |
1678 | 1678 | int mnt_flags, struct list_head *fslist) |
1679 | 1679 | { |
1680 | 1680 | int err; |
1681 | 1681 | |
1682 | 1682 | down_write(&namespace_sem); |
1683 | 1683 | /* Something was mounted here while we slept */ |
1684 | - while (d_mountpoint(nd->path.dentry) && | |
1685 | - follow_down(&nd->path.mnt, &nd->path.dentry)) | |
1684 | + while (d_mountpoint(path->dentry) && | |
1685 | + follow_down(&path->mnt, &path->dentry)) | |
1686 | 1686 | ; |
1687 | 1687 | err = -EINVAL; |
1688 | - if (!check_mnt(nd->path.mnt)) | |
1688 | + if (!check_mnt(path->mnt)) | |
1689 | 1689 | goto unlock; |
1690 | 1690 | |
1691 | 1691 | /* Refuse the same filesystem on the same mount point */ |
1692 | 1692 | err = -EBUSY; |
1693 | - if (nd->path.mnt->mnt_sb == newmnt->mnt_sb && | |
1694 | - nd->path.mnt->mnt_root == nd->path.dentry) | |
1693 | + if (path->mnt->mnt_sb == newmnt->mnt_sb && | |
1694 | + path->mnt->mnt_root == path->dentry) | |
1695 | 1695 | goto unlock; |
1696 | 1696 | |
1697 | 1697 | err = -EINVAL; |
... | ... | @@ -1699,7 +1699,7 @@ |
1699 | 1699 | goto unlock; |
1700 | 1700 | |
1701 | 1701 | newmnt->mnt_flags = mnt_flags; |
1702 | - if ((err = graft_tree(newmnt, &nd->path))) | |
1702 | + if ((err = graft_tree(newmnt, path))) | |
1703 | 1703 | goto unlock; |
1704 | 1704 | |
1705 | 1705 | if (fslist) /* add to the specified expiration list */ |
fs/nfs/namespace.c
... | ... | @@ -129,7 +129,7 @@ |
129 | 129 | goto out_err; |
130 | 130 | |
131 | 131 | mntget(mnt); |
132 | - err = do_add_mount(mnt, nd, nd->path.mnt->mnt_flags|MNT_SHRINKABLE, | |
132 | + err = do_add_mount(mnt, &nd->path, nd->path.mnt->mnt_flags|MNT_SHRINKABLE, | |
133 | 133 | &nfs_automount_list); |
134 | 134 | if (err < 0) { |
135 | 135 | mntput(mnt); |
include/linux/mount.h
... | ... | @@ -105,7 +105,8 @@ |
105 | 105 | |
106 | 106 | struct nameidata; |
107 | 107 | |
108 | -extern int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd, | |
108 | +struct path; | |
109 | +extern int do_add_mount(struct vfsmount *newmnt, struct path *path, | |
109 | 110 | int mnt_flags, struct list_head *fslist); |
110 | 111 | |
111 | 112 | extern void mark_mounts_for_expiry(struct list_head *mounts); |