diff options
-rw-r--r-- | fs/mount.h | 2 | ||||
-rw-r--r-- | fs/namespace.c | 42 | ||||
-rw-r--r-- | fs/pnode.c | 6 | ||||
-rw-r--r-- | include/linux/mount.h | 2 |
4 files changed, 26 insertions, 26 deletions
diff --git a/fs/mount.h b/fs/mount.h index 452ae41e0131..e4ecf59c9353 100644 --- a/fs/mount.h +++ b/fs/mount.h | |||
@@ -17,6 +17,8 @@ struct mount { | |||
17 | int mnt_count; | 17 | int mnt_count; |
18 | int mnt_writers; | 18 | int mnt_writers; |
19 | #endif | 19 | #endif |
20 | struct list_head mnt_mounts; /* list of children, anchored here */ | ||
21 | struct list_head mnt_child; /* and going through their mnt_child */ | ||
20 | }; | 22 | }; |
21 | 23 | ||
22 | static inline struct mount *real_mount(struct vfsmount *mnt) | 24 | static inline struct mount *real_mount(struct vfsmount *mnt) |
diff --git a/fs/namespace.c b/fs/namespace.c index 3fdd30add4f9..9ceb03fe176f 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -200,8 +200,8 @@ static struct mount *alloc_vfsmnt(const char *name) | |||
200 | #endif | 200 | #endif |
201 | 201 | ||
202 | INIT_LIST_HEAD(&p->mnt_hash); | 202 | INIT_LIST_HEAD(&p->mnt_hash); |
203 | INIT_LIST_HEAD(&mnt->mnt_child); | 203 | INIT_LIST_HEAD(&p->mnt_child); |
204 | INIT_LIST_HEAD(&mnt->mnt_mounts); | 204 | INIT_LIST_HEAD(&p->mnt_mounts); |
205 | INIT_LIST_HEAD(&mnt->mnt_list); | 205 | INIT_LIST_HEAD(&mnt->mnt_list); |
206 | INIT_LIST_HEAD(&mnt->mnt_expire); | 206 | INIT_LIST_HEAD(&mnt->mnt_expire); |
207 | INIT_LIST_HEAD(&mnt->mnt_share); | 207 | INIT_LIST_HEAD(&mnt->mnt_share); |
@@ -562,7 +562,7 @@ static void detach_mnt(struct mount *mnt, struct path *old_path) | |||
562 | old_path->mnt = &mnt->mnt_parent->mnt; | 562 | old_path->mnt = &mnt->mnt_parent->mnt; |
563 | mnt->mnt_parent = mnt; | 563 | mnt->mnt_parent = mnt; |
564 | mnt->mnt_mountpoint = mnt->mnt.mnt_root; | 564 | mnt->mnt_mountpoint = mnt->mnt.mnt_root; |
565 | list_del_init(&mnt->mnt.mnt_child); | 565 | list_del_init(&mnt->mnt_child); |
566 | list_del_init(&mnt->mnt_hash); | 566 | list_del_init(&mnt->mnt_hash); |
567 | dentry_reset_mounted(old_path->dentry); | 567 | dentry_reset_mounted(old_path->dentry); |
568 | } | 568 | } |
@@ -588,7 +588,7 @@ static void attach_mnt(struct mount *mnt, struct path *path) | |||
588 | mnt_set_mountpoint(path->mnt, path->dentry, mnt); | 588 | mnt_set_mountpoint(path->mnt, path->dentry, mnt); |
589 | list_add_tail(&mnt->mnt_hash, mount_hashtable + | 589 | list_add_tail(&mnt->mnt_hash, mount_hashtable + |
590 | hash(path->mnt, path->dentry)); | 590 | hash(path->mnt, path->dentry)); |
591 | list_add_tail(&mnt->mnt.mnt_child, &path->mnt->mnt_mounts); | 591 | list_add_tail(&mnt->mnt_child, &real_mount(path->mnt)->mnt_mounts); |
592 | } | 592 | } |
593 | 593 | ||
594 | static inline void __mnt_make_longterm(struct mount *mnt) | 594 | static inline void __mnt_make_longterm(struct mount *mnt) |
@@ -628,32 +628,32 @@ static void commit_tree(struct mount *mnt) | |||
628 | 628 | ||
629 | list_add_tail(&mnt->mnt_hash, mount_hashtable + | 629 | list_add_tail(&mnt->mnt_hash, mount_hashtable + |
630 | hash(&parent->mnt, mnt->mnt_mountpoint)); | 630 | hash(&parent->mnt, mnt->mnt_mountpoint)); |
631 | list_add_tail(&mnt->mnt.mnt_child, &parent->mnt.mnt_mounts); | 631 | list_add_tail(&mnt->mnt_child, &parent->mnt_mounts); |
632 | touch_mnt_namespace(n); | 632 | touch_mnt_namespace(n); |
633 | } | 633 | } |
634 | 634 | ||
635 | static struct mount *next_mnt(struct mount *p, struct vfsmount *root) | 635 | static struct mount *next_mnt(struct mount *p, struct vfsmount *root) |
636 | { | 636 | { |
637 | struct list_head *next = p->mnt.mnt_mounts.next; | 637 | struct list_head *next = p->mnt_mounts.next; |
638 | if (next == &p->mnt.mnt_mounts) { | 638 | if (next == &p->mnt_mounts) { |
639 | while (1) { | 639 | while (1) { |
640 | if (&p->mnt == root) | 640 | if (&p->mnt == root) |
641 | return NULL; | 641 | return NULL; |
642 | next = p->mnt.mnt_child.next; | 642 | next = p->mnt_child.next; |
643 | if (next != &p->mnt_parent->mnt.mnt_mounts) | 643 | if (next != &p->mnt_parent->mnt_mounts) |
644 | break; | 644 | break; |
645 | p = p->mnt_parent; | 645 | p = p->mnt_parent; |
646 | } | 646 | } |
647 | } | 647 | } |
648 | return list_entry(next, struct mount, mnt.mnt_child); | 648 | return list_entry(next, struct mount, mnt_child); |
649 | } | 649 | } |
650 | 650 | ||
651 | static struct mount *skip_mnt_tree(struct mount *p) | 651 | static struct mount *skip_mnt_tree(struct mount *p) |
652 | { | 652 | { |
653 | struct list_head *prev = p->mnt.mnt_mounts.prev; | 653 | struct list_head *prev = p->mnt_mounts.prev; |
654 | while (prev != &p->mnt.mnt_mounts) { | 654 | while (prev != &p->mnt_mounts) { |
655 | p = list_entry(prev, struct mount, mnt.mnt_child); | 655 | p = list_entry(prev, struct mount, mnt_child); |
656 | prev = p->mnt.mnt_mounts.prev; | 656 | prev = p->mnt_mounts.prev; |
657 | } | 657 | } |
658 | return p; | 658 | return p; |
659 | } | 659 | } |
@@ -1238,7 +1238,7 @@ void umount_tree(struct mount *mnt, int propagate, struct list_head *kill) | |||
1238 | __touch_mnt_namespace(p->mnt.mnt_ns); | 1238 | __touch_mnt_namespace(p->mnt.mnt_ns); |
1239 | p->mnt.mnt_ns = NULL; | 1239 | p->mnt.mnt_ns = NULL; |
1240 | __mnt_make_shortterm(p); | 1240 | __mnt_make_shortterm(p); |
1241 | list_del_init(&p->mnt.mnt_child); | 1241 | list_del_init(&p->mnt_child); |
1242 | if (mnt_has_parent(p)) { | 1242 | if (mnt_has_parent(p)) { |
1243 | p->mnt_parent->mnt.mnt_ghosts++; | 1243 | p->mnt_parent->mnt.mnt_ghosts++; |
1244 | dentry_reset_mounted(p->mnt_mountpoint); | 1244 | dentry_reset_mounted(p->mnt_mountpoint); |
@@ -1427,7 +1427,7 @@ struct mount *copy_tree(struct mount *mnt, struct dentry *dentry, | |||
1427 | q->mnt_mountpoint = mnt->mnt_mountpoint; | 1427 | q->mnt_mountpoint = mnt->mnt_mountpoint; |
1428 | 1428 | ||
1429 | p = mnt; | 1429 | p = mnt; |
1430 | list_for_each_entry(r, &mnt->mnt.mnt_mounts, mnt.mnt_child) { | 1430 | list_for_each_entry(r, &mnt->mnt_mounts, mnt_child) { |
1431 | struct mount *s; | 1431 | struct mount *s; |
1432 | if (!is_subdir(r->mnt_mountpoint, dentry)) | 1432 | if (!is_subdir(r->mnt_mountpoint, dentry)) |
1433 | continue; | 1433 | continue; |
@@ -2134,11 +2134,11 @@ static int select_submounts(struct mount *parent, struct list_head *graveyard) | |||
2134 | int found = 0; | 2134 | int found = 0; |
2135 | 2135 | ||
2136 | repeat: | 2136 | repeat: |
2137 | next = this_parent->mnt.mnt_mounts.next; | 2137 | next = this_parent->mnt_mounts.next; |
2138 | resume: | 2138 | resume: |
2139 | while (next != &this_parent->mnt.mnt_mounts) { | 2139 | while (next != &this_parent->mnt_mounts) { |
2140 | struct list_head *tmp = next; | 2140 | struct list_head *tmp = next; |
2141 | struct mount *mnt = list_entry(tmp, struct mount, mnt.mnt_child); | 2141 | struct mount *mnt = list_entry(tmp, struct mount, mnt_child); |
2142 | 2142 | ||
2143 | next = tmp->next; | 2143 | next = tmp->next; |
2144 | if (!(mnt->mnt.mnt_flags & MNT_SHRINKABLE)) | 2144 | if (!(mnt->mnt.mnt_flags & MNT_SHRINKABLE)) |
@@ -2146,7 +2146,7 @@ resume: | |||
2146 | /* | 2146 | /* |
2147 | * Descend a level if the d_mounts list is non-empty. | 2147 | * Descend a level if the d_mounts list is non-empty. |
2148 | */ | 2148 | */ |
2149 | if (!list_empty(&mnt->mnt.mnt_mounts)) { | 2149 | if (!list_empty(&mnt->mnt_mounts)) { |
2150 | this_parent = mnt; | 2150 | this_parent = mnt; |
2151 | goto repeat; | 2151 | goto repeat; |
2152 | } | 2152 | } |
@@ -2160,7 +2160,7 @@ resume: | |||
2160 | * All done at this level ... ascend and resume the search | 2160 | * All done at this level ... ascend and resume the search |
2161 | */ | 2161 | */ |
2162 | if (this_parent != parent) { | 2162 | if (this_parent != parent) { |
2163 | next = this_parent->mnt.mnt_child.next; | 2163 | next = this_parent->mnt_child.next; |
2164 | this_parent = this_parent->mnt_parent; | 2164 | this_parent = this_parent->mnt_parent; |
2165 | goto resume; | 2165 | goto resume; |
2166 | } | 2166 | } |
diff --git a/fs/pnode.c b/fs/pnode.c index 50fdb29eebfe..8cd90d2ec05e 100644 --- a/fs/pnode.c +++ b/fs/pnode.c | |||
@@ -303,13 +303,13 @@ int propagate_mount_busy(struct mount *mnt, int refcnt) | |||
303 | * If not, we don't have to go checking for all other | 303 | * If not, we don't have to go checking for all other |
304 | * mounts | 304 | * mounts |
305 | */ | 305 | */ |
306 | if (!list_empty(&mnt->mnt.mnt_mounts) || do_refcount_check(mnt, refcnt)) | 306 | if (!list_empty(&mnt->mnt_mounts) || do_refcount_check(mnt, refcnt)) |
307 | return 1; | 307 | return 1; |
308 | 308 | ||
309 | for (m = propagation_next(&parent->mnt, &parent->mnt); m; | 309 | for (m = propagation_next(&parent->mnt, &parent->mnt); m; |
310 | m = propagation_next(m, &parent->mnt)) { | 310 | m = propagation_next(m, &parent->mnt)) { |
311 | child = __lookup_mnt(m, mnt->mnt_mountpoint, 0); | 311 | child = __lookup_mnt(m, mnt->mnt_mountpoint, 0); |
312 | if (child && list_empty(&child->mnt.mnt_mounts) && | 312 | if (child && list_empty(&child->mnt_mounts) && |
313 | (ret = do_refcount_check(child, 1))) | 313 | (ret = do_refcount_check(child, 1))) |
314 | break; | 314 | break; |
315 | } | 315 | } |
@@ -336,7 +336,7 @@ static void __propagate_umount(struct mount *mnt) | |||
336 | * umount the child only if the child has no | 336 | * umount the child only if the child has no |
337 | * other children | 337 | * other children |
338 | */ | 338 | */ |
339 | if (child && list_empty(&child->mnt.mnt_mounts)) | 339 | if (child && list_empty(&child->mnt_mounts)) |
340 | list_move_tail(&child->mnt_hash, &mnt->mnt_hash); | 340 | list_move_tail(&child->mnt_hash, &mnt->mnt_hash); |
341 | } | 341 | } |
342 | } | 342 | } |
diff --git a/include/linux/mount.h b/include/linux/mount.h index cc01ed1bc719..e9990254d4d0 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -50,8 +50,6 @@ struct mnt_namespace; | |||
50 | struct vfsmount { | 50 | struct vfsmount { |
51 | struct dentry *mnt_root; /* root of the mounted tree */ | 51 | struct dentry *mnt_root; /* root of the mounted tree */ |
52 | struct super_block *mnt_sb; /* pointer to superblock */ | 52 | struct super_block *mnt_sb; /* pointer to superblock */ |
53 | struct list_head mnt_mounts; /* list of children, anchored here */ | ||
54 | struct list_head mnt_child; /* and going through their mnt_child */ | ||
55 | int mnt_flags; | 53 | int mnt_flags; |
56 | /* 4 bytes hole on 64bits arches without fsnotify */ | 54 | /* 4 bytes hole on 64bits arches without fsnotify */ |
57 | #ifdef CONFIG_FSNOTIFY | 55 | #ifdef CONFIG_FSNOTIFY |