diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-11-24 23:24:33 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-03 22:57:06 -0500 |
commit | 6b41d536f7c84e7cb1c1462073150277e46f6ea8 (patch) | |
tree | fd75f1d76947bdfc42772ff3eef4b60977162840 /fs/namespace.c | |
parent | 68e8a9feab251f9d3c8fd9e9893c97843bcd4bd0 (diff) |
vfs: take mnt_child/mnt_mounts to struct mount
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r-- | fs/namespace.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 3fdd30add4f..9ceb03fe176 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 | } |