diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-11-24 21:15:14 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-03 22:57:02 -0500 |
commit | 692afc312b38c9367a1125927941d33ab2ce852a (patch) | |
tree | 8a3b6311b46de997f008fac47d29aab0e63f32b0 /fs | |
parent | 761d5c38eb3d8e2aa7394726dccab245bfe2f41c (diff) |
vfs: spread struct mount - shrink_submounts/select_submounts
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/namespace.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 5bb40c52b2af..fa0f30d862c6 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -1244,7 +1244,7 @@ void umount_tree(struct mount *mnt, int propagate, struct list_head *kill) | |||
1244 | list_splice(&tmp_list, kill); | 1244 | list_splice(&tmp_list, kill); |
1245 | } | 1245 | } |
1246 | 1246 | ||
1247 | static void shrink_submounts(struct vfsmount *mnt, struct list_head *umounts); | 1247 | static void shrink_submounts(struct mount *mnt, struct list_head *umounts); |
1248 | 1248 | ||
1249 | static int do_umount(struct vfsmount *mnt, int flags) | 1249 | static int do_umount(struct vfsmount *mnt, int flags) |
1250 | { | 1250 | { |
@@ -1322,7 +1322,7 @@ static int do_umount(struct vfsmount *mnt, int flags) | |||
1322 | event++; | 1322 | event++; |
1323 | 1323 | ||
1324 | if (!(flags & MNT_DETACH)) | 1324 | if (!(flags & MNT_DETACH)) |
1325 | shrink_submounts(mnt, &umount_list); | 1325 | shrink_submounts(real_mount(mnt), &umount_list); |
1326 | 1326 | ||
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)) { |
@@ -2121,32 +2121,32 @@ EXPORT_SYMBOL_GPL(mark_mounts_for_expiry); | |||
2121 | * search the list of submounts for a given mountpoint, and move any | 2121 | * search the list of submounts for a given mountpoint, and move any |
2122 | * shrinkable submounts to the 'graveyard' list. | 2122 | * shrinkable submounts to the 'graveyard' list. |
2123 | */ | 2123 | */ |
2124 | static int select_submounts(struct vfsmount *parent, struct list_head *graveyard) | 2124 | static int select_submounts(struct mount *parent, struct list_head *graveyard) |
2125 | { | 2125 | { |
2126 | struct vfsmount *this_parent = parent; | 2126 | struct mount *this_parent = parent; |
2127 | struct list_head *next; | 2127 | struct list_head *next; |
2128 | int found = 0; | 2128 | int found = 0; |
2129 | 2129 | ||
2130 | repeat: | 2130 | repeat: |
2131 | next = this_parent->mnt_mounts.next; | 2131 | next = this_parent->mnt.mnt_mounts.next; |
2132 | resume: | 2132 | resume: |
2133 | while (next != &this_parent->mnt_mounts) { | 2133 | while (next != &this_parent->mnt.mnt_mounts) { |
2134 | struct list_head *tmp = next; | 2134 | struct list_head *tmp = next; |
2135 | struct vfsmount *mnt = list_entry(tmp, struct vfsmount, mnt_child); | 2135 | struct mount *mnt = list_entry(tmp, struct mount, mnt.mnt_child); |
2136 | 2136 | ||
2137 | next = tmp->next; | 2137 | next = tmp->next; |
2138 | if (!(mnt->mnt_flags & MNT_SHRINKABLE)) | 2138 | if (!(mnt->mnt.mnt_flags & MNT_SHRINKABLE)) |
2139 | continue; | 2139 | continue; |
2140 | /* | 2140 | /* |
2141 | * Descend a level if the d_mounts list is non-empty. | 2141 | * Descend a level if the d_mounts list is non-empty. |
2142 | */ | 2142 | */ |
2143 | if (!list_empty(&mnt->mnt_mounts)) { | 2143 | if (!list_empty(&mnt->mnt.mnt_mounts)) { |
2144 | this_parent = mnt; | 2144 | this_parent = mnt; |
2145 | goto repeat; | 2145 | goto repeat; |
2146 | } | 2146 | } |
2147 | 2147 | ||
2148 | if (!propagate_mount_busy(mnt, 1)) { | 2148 | if (!propagate_mount_busy(&mnt->mnt, 1)) { |
2149 | list_move_tail(&mnt->mnt_expire, graveyard); | 2149 | list_move_tail(&mnt->mnt.mnt_expire, graveyard); |
2150 | found++; | 2150 | found++; |
2151 | } | 2151 | } |
2152 | } | 2152 | } |
@@ -2154,8 +2154,8 @@ resume: | |||
2154 | * All done at this level ... ascend and resume the search | 2154 | * All done at this level ... ascend and resume the search |
2155 | */ | 2155 | */ |
2156 | if (this_parent != parent) { | 2156 | if (this_parent != parent) { |
2157 | next = this_parent->mnt_child.next; | 2157 | next = this_parent->mnt.mnt_child.next; |
2158 | this_parent = this_parent->mnt_parent; | 2158 | this_parent = real_mount(this_parent->mnt.mnt_parent); |
2159 | goto resume; | 2159 | goto resume; |
2160 | } | 2160 | } |
2161 | return found; | 2161 | return found; |
@@ -2167,7 +2167,7 @@ resume: | |||
2167 | * | 2167 | * |
2168 | * vfsmount_lock must be held for write | 2168 | * vfsmount_lock must be held for write |
2169 | */ | 2169 | */ |
2170 | static void shrink_submounts(struct vfsmount *mnt, struct list_head *umounts) | 2170 | static void shrink_submounts(struct mount *mnt, struct list_head *umounts) |
2171 | { | 2171 | { |
2172 | LIST_HEAD(graveyard); | 2172 | LIST_HEAD(graveyard); |
2173 | struct mount *m; | 2173 | struct mount *m; |