aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-03-16 14:42:19 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-04-09 14:12:53 -0400
commit3ab6abee59ac9ca84cc4a1e31224f1dccd44394c (patch)
treeef7bcc620732791eac524d7f78319731181ec82c /fs/namespace.c
parentb54b9be7824d84158cd90305820e2c3914f74ad9 (diff)
more conversions to namespace_unlock()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index c04afaf0e3dc..7563270a43ab 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1426,13 +1426,11 @@ struct vfsmount *collect_mounts(struct path *path)
1426 1426
1427void drop_collected_mounts(struct vfsmount *mnt) 1427void drop_collected_mounts(struct vfsmount *mnt)
1428{ 1428{
1429 LIST_HEAD(umount_list);
1430 down_write(&namespace_sem); 1429 down_write(&namespace_sem);
1431 br_write_lock(&vfsmount_lock); 1430 br_write_lock(&vfsmount_lock);
1432 umount_tree(real_mount(mnt), 0, &umount_list); 1431 umount_tree(real_mount(mnt), 0, &unmounted);
1433 br_write_unlock(&vfsmount_lock); 1432 br_write_unlock(&vfsmount_lock);
1434 up_write(&namespace_sem); 1433 namespace_unlock();
1435 release_mounts(&umount_list);
1436} 1434}
1437 1435
1438int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg, 1436int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
@@ -2060,7 +2058,6 @@ void mark_mounts_for_expiry(struct list_head *mounts)
2060{ 2058{
2061 struct mount *mnt, *next; 2059 struct mount *mnt, *next;
2062 LIST_HEAD(graveyard); 2060 LIST_HEAD(graveyard);
2063 LIST_HEAD(umounts);
2064 2061
2065 if (list_empty(mounts)) 2062 if (list_empty(mounts))
2066 return; 2063 return;
@@ -2083,12 +2080,10 @@ void mark_mounts_for_expiry(struct list_head *mounts)
2083 while (!list_empty(&graveyard)) { 2080 while (!list_empty(&graveyard)) {
2084 mnt = list_first_entry(&graveyard, struct mount, mnt_expire); 2081 mnt = list_first_entry(&graveyard, struct mount, mnt_expire);
2085 touch_mnt_namespace(mnt->mnt_ns); 2082 touch_mnt_namespace(mnt->mnt_ns);
2086 umount_tree(mnt, 1, &umounts); 2083 umount_tree(mnt, 1, &unmounted);
2087 } 2084 }
2088 br_write_unlock(&vfsmount_lock); 2085 br_write_unlock(&vfsmount_lock);
2089 up_write(&namespace_sem); 2086 namespace_unlock();
2090
2091 release_mounts(&umounts);
2092} 2087}
2093 2088
2094EXPORT_SYMBOL_GPL(mark_mounts_for_expiry); 2089EXPORT_SYMBOL_GPL(mark_mounts_for_expiry);
@@ -2741,16 +2736,13 @@ void __init mnt_init(void)
2741 2736
2742void put_mnt_ns(struct mnt_namespace *ns) 2737void put_mnt_ns(struct mnt_namespace *ns)
2743{ 2738{
2744 LIST_HEAD(umount_list);
2745
2746 if (!atomic_dec_and_test(&ns->count)) 2739 if (!atomic_dec_and_test(&ns->count))
2747 return; 2740 return;
2748 down_write(&namespace_sem); 2741 down_write(&namespace_sem);
2749 br_write_lock(&vfsmount_lock); 2742 br_write_lock(&vfsmount_lock);
2750 umount_tree(ns->root, 0, &umount_list); 2743 umount_tree(ns->root, 0, &unmounted);
2751 br_write_unlock(&vfsmount_lock); 2744 br_write_unlock(&vfsmount_lock);
2752 up_write(&namespace_sem); 2745 namespace_unlock();
2753 release_mounts(&umount_list);
2754 free_mnt_ns(ns); 2746 free_mnt_ns(ns);
2755} 2747}
2756 2748