aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2015-01-15 23:58:33 -0500
committerEric W. Biederman <ebiederm@xmission.com>2015-04-09 12:39:54 -0400
commit6a46c5735c29175da55b2fa9d53775182422cdd7 (patch)
tree1f98d10a0d3485f49bd59cc78ce0aee74de577c7 /fs
parent7bdb11de8ee4f4ae195e2fa19efd304e0b36c63b (diff)
mnt: Factor umount_mnt from umount_tree
For future use factor out a function umount_mnt from umount_tree. This function unhashes a mount and remembers where the mount was mounted so that eventually when the code makes it to a sleeping context the mountpoint can be dput. Cc: stable@vger.kernel.org Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/namespace.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index e669a3bf86e7..010d5bebcb7e 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -822,6 +822,16 @@ static void detach_mnt(struct mount *mnt, struct path *old_path)
822/* 822/*
823 * vfsmount lock must be held for write 823 * vfsmount lock must be held for write
824 */ 824 */
825static void umount_mnt(struct mount *mnt)
826{
827 /* old mountpoint will be dropped when we can do that */
828 mnt->mnt_ex_mountpoint = mnt->mnt_mountpoint;
829 unhash_mnt(mnt);
830}
831
832/*
833 * vfsmount lock must be held for write
834 */
825void mnt_set_mountpoint(struct mount *mnt, 835void mnt_set_mountpoint(struct mount *mnt,
826 struct mountpoint *mp, 836 struct mountpoint *mp,
827 struct mount *child_mnt) 837 struct mount *child_mnt)
@@ -1371,9 +1381,7 @@ static void umount_tree(struct mount *mnt, enum umount_tree_flags how)
1371 pin_insert_group(&p->mnt_umount, &p->mnt_parent->mnt, &unmounted); 1381 pin_insert_group(&p->mnt_umount, &p->mnt_parent->mnt, &unmounted);
1372 if (mnt_has_parent(p)) { 1382 if (mnt_has_parent(p)) {
1373 mnt_add_count(p->mnt_parent, -1); 1383 mnt_add_count(p->mnt_parent, -1);
1374 /* old mountpoint will be dropped when we can do that */ 1384 umount_mnt(p);
1375 p->mnt_ex_mountpoint = p->mnt_mountpoint;
1376 unhash_mnt(p);
1377 } 1385 }
1378 change_mnt_propagation(p, MS_PRIVATE); 1386 change_mnt_propagation(p, MS_PRIVATE);
1379 } 1387 }