aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-11-24 21:07:43 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-03 22:57:02 -0500
commit761d5c38eb3d8e2aa7394726dccab245bfe2f41c (patch)
tree3fea2388dc65e41a2bfdd987e61984b5af47c98a /fs/namespace.c
parent1b8e5564b9d34cbeb3047dd2be8ec9cd5e2785e2 (diff)
vfs: spread struct mount - umount_tree argument
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 121e0032c9de..5bb40c52b2af 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1217,12 +1217,12 @@ void release_mounts(struct list_head *head)
1217 * vfsmount lock must be held for write 1217 * vfsmount lock must be held for write
1218 * namespace_sem must be held for write 1218 * namespace_sem must be held for write
1219 */ 1219 */
1220void umount_tree(struct vfsmount *mnt, int propagate, struct list_head *kill) 1220void umount_tree(struct mount *mnt, int propagate, struct list_head *kill)
1221{ 1221{
1222 LIST_HEAD(tmp_list); 1222 LIST_HEAD(tmp_list);
1223 struct mount *p; 1223 struct mount *p;
1224 1224
1225 for (p = real_mount(mnt); p; p = next_mnt(p, mnt)) 1225 for (p = mnt; p; p = next_mnt(p, &mnt->mnt))
1226 list_move(&p->mnt_hash, &tmp_list); 1226 list_move(&p->mnt_hash, &tmp_list);
1227 1227
1228 if (propagate) 1228 if (propagate)
@@ -1327,7 +1327,7 @@ static int do_umount(struct vfsmount *mnt, int flags)
1327 retval = -EBUSY; 1327 retval = -EBUSY;
1328 if (flags & MNT_DETACH || !propagate_mount_busy(mnt, 2)) { 1328 if (flags & MNT_DETACH || !propagate_mount_busy(mnt, 2)) {
1329 if (!list_empty(&mnt->mnt_list)) 1329 if (!list_empty(&mnt->mnt_list))
1330 umount_tree(mnt, 1, &umount_list); 1330 umount_tree(real_mount(mnt), 1, &umount_list);
1331 retval = 0; 1331 retval = 0;
1332 } 1332 }
1333 br_write_unlock(vfsmount_lock); 1333 br_write_unlock(vfsmount_lock);
@@ -1455,7 +1455,7 @@ Enomem:
1455 if (res) { 1455 if (res) {
1456 LIST_HEAD(umount_list); 1456 LIST_HEAD(umount_list);
1457 br_write_lock(vfsmount_lock); 1457 br_write_lock(vfsmount_lock);
1458 umount_tree(&res->mnt, 0, &umount_list); 1458 umount_tree(res, 0, &umount_list);
1459 br_write_unlock(vfsmount_lock); 1459 br_write_unlock(vfsmount_lock);
1460 release_mounts(&umount_list); 1460 release_mounts(&umount_list);
1461 } 1461 }
@@ -1476,7 +1476,7 @@ void drop_collected_mounts(struct vfsmount *mnt)
1476 LIST_HEAD(umount_list); 1476 LIST_HEAD(umount_list);
1477 down_write(&namespace_sem); 1477 down_write(&namespace_sem);
1478 br_write_lock(vfsmount_lock); 1478 br_write_lock(vfsmount_lock);
1479 umount_tree(mnt, 0, &umount_list); 1479 umount_tree(real_mount(mnt), 0, &umount_list);
1480 br_write_unlock(vfsmount_lock); 1480 br_write_unlock(vfsmount_lock);
1481 up_write(&namespace_sem); 1481 up_write(&namespace_sem);
1482 release_mounts(&umount_list); 1482 release_mounts(&umount_list);
@@ -1773,7 +1773,7 @@ static int do_loopback(struct path *path, char *old_name,
1773 err = graft_tree(&mnt->mnt, path); 1773 err = graft_tree(&mnt->mnt, path);
1774 if (err) { 1774 if (err) {
1775 br_write_lock(vfsmount_lock); 1775 br_write_lock(vfsmount_lock);
1776 umount_tree(&mnt->mnt, 0, &umount_list); 1776 umount_tree(mnt, 0, &umount_list);
1777 br_write_unlock(vfsmount_lock); 1777 br_write_unlock(vfsmount_lock);
1778 } 1778 }
1779out2: 1779out2:
@@ -2080,7 +2080,7 @@ EXPORT_SYMBOL(mnt_set_expiry);
2080 */ 2080 */
2081void mark_mounts_for_expiry(struct list_head *mounts) 2081void mark_mounts_for_expiry(struct list_head *mounts)
2082{ 2082{
2083 struct vfsmount *mnt, *next; 2083 struct mount *mnt, *next;
2084 LIST_HEAD(graveyard); 2084 LIST_HEAD(graveyard);
2085 LIST_HEAD(umounts); 2085 LIST_HEAD(umounts);
2086 2086
@@ -2096,15 +2096,15 @@ void mark_mounts_for_expiry(struct list_head *mounts)
2096 * - still marked for expiry (marked on the last call here; marks are 2096 * - still marked for expiry (marked on the last call here; marks are
2097 * cleared by mntput()) 2097 * cleared by mntput())
2098 */ 2098 */
2099 list_for_each_entry_safe(mnt, next, mounts, mnt_expire) { 2099 list_for_each_entry_safe(mnt, next, mounts, mnt.mnt_expire) {
2100 if (!xchg(&mnt->mnt_expiry_mark, 1) || 2100 if (!xchg(&mnt->mnt.mnt_expiry_mark, 1) ||
2101 propagate_mount_busy(mnt, 1)) 2101 propagate_mount_busy(&mnt->mnt, 1))
2102 continue; 2102 continue;
2103 list_move(&mnt->mnt_expire, &graveyard); 2103 list_move(&mnt->mnt.mnt_expire, &graveyard);
2104 } 2104 }
2105 while (!list_empty(&graveyard)) { 2105 while (!list_empty(&graveyard)) {
2106 mnt = list_first_entry(&graveyard, struct vfsmount, mnt_expire); 2106 mnt = list_first_entry(&graveyard, struct mount, mnt.mnt_expire);
2107 touch_mnt_namespace(mnt->mnt_ns); 2107 touch_mnt_namespace(mnt->mnt.mnt_ns);
2108 umount_tree(mnt, 1, &umounts); 2108 umount_tree(mnt, 1, &umounts);
2109 } 2109 }
2110 br_write_unlock(vfsmount_lock); 2110 br_write_unlock(vfsmount_lock);
@@ -2170,14 +2170,14 @@ resume:
2170static void shrink_submounts(struct vfsmount *mnt, struct list_head *umounts) 2170static void shrink_submounts(struct vfsmount *mnt, struct list_head *umounts)
2171{ 2171{
2172 LIST_HEAD(graveyard); 2172 LIST_HEAD(graveyard);
2173 struct vfsmount *m; 2173 struct mount *m;
2174 2174
2175 /* extract submounts of 'mountpoint' from the expiration list */ 2175 /* extract submounts of 'mountpoint' from the expiration list */
2176 while (select_submounts(mnt, &graveyard)) { 2176 while (select_submounts(mnt, &graveyard)) {
2177 while (!list_empty(&graveyard)) { 2177 while (!list_empty(&graveyard)) {
2178 m = list_first_entry(&graveyard, struct vfsmount, 2178 m = list_first_entry(&graveyard, struct mount,
2179 mnt_expire); 2179 mnt.mnt_expire);
2180 touch_mnt_namespace(m->mnt_ns); 2180 touch_mnt_namespace(m->mnt.mnt_ns);
2181 umount_tree(m, 1, umounts); 2181 umount_tree(m, 1, umounts);
2182 } 2182 }
2183 } 2183 }
@@ -2750,7 +2750,7 @@ void put_mnt_ns(struct mnt_namespace *ns)
2750 return; 2750 return;
2751 down_write(&namespace_sem); 2751 down_write(&namespace_sem);
2752 br_write_lock(vfsmount_lock); 2752 br_write_lock(vfsmount_lock);
2753 umount_tree(ns->root, 0, &umount_list); 2753 umount_tree(real_mount(ns->root), 0, &umount_list);
2754 br_write_unlock(vfsmount_lock); 2754 br_write_unlock(vfsmount_lock);
2755 up_write(&namespace_sem); 2755 up_write(&namespace_sem);
2756 release_mounts(&umount_list); 2756 release_mounts(&umount_list);