diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-11-24 21:01:32 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-03 22:57:02 -0500 |
commit | 1b8e5564b9d34cbeb3047dd2be8ec9cd5e2785e2 (patch) | |
tree | 61633a9593b4d1c337d7182aee2e2d2af9e9f299 | |
parent | d5e50f74dd2ed6dd1bb4bf6fe58e5a7de4b77953 (diff) |
vfs: the first spoils - mnt_hash moved
taken out of struct vfsmount into struct mount
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/mount.h | 1 | ||||
-rw-r--r-- | fs/namespace.c | 24 | ||||
-rw-r--r-- | fs/pnode.c | 10 | ||||
-rw-r--r-- | include/linux/mount.h | 1 |
4 files changed, 18 insertions, 18 deletions
diff --git a/fs/mount.h b/fs/mount.h index 44e5b6f54b7e..831e7c86835b 100644 --- a/fs/mount.h +++ b/fs/mount.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #include <linux/mount.h> | 1 | #include <linux/mount.h> |
2 | 2 | ||
3 | struct mount { | 3 | struct mount { |
4 | struct list_head mnt_hash; | ||
4 | struct vfsmount mnt; | 5 | struct vfsmount mnt; |
5 | }; | 6 | }; |
6 | 7 | ||
diff --git a/fs/namespace.c b/fs/namespace.c index 76412348d5be..121e0032c9de 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -199,7 +199,7 @@ static struct mount *alloc_vfsmnt(const char *name) | |||
199 | mnt->mnt_writers = 0; | 199 | mnt->mnt_writers = 0; |
200 | #endif | 200 | #endif |
201 | 201 | ||
202 | INIT_LIST_HEAD(&p->mnt.mnt_hash); | 202 | INIT_LIST_HEAD(&p->mnt_hash); |
203 | INIT_LIST_HEAD(&mnt->mnt_child); | 203 | INIT_LIST_HEAD(&mnt->mnt_child); |
204 | INIT_LIST_HEAD(&mnt->mnt_mounts); | 204 | INIT_LIST_HEAD(&mnt->mnt_mounts); |
205 | INIT_LIST_HEAD(&mnt->mnt_list); | 205 | INIT_LIST_HEAD(&mnt->mnt_list); |
@@ -475,7 +475,7 @@ struct mount *__lookup_mnt(struct vfsmount *mnt, struct dentry *dentry, | |||
475 | p = NULL; | 475 | p = NULL; |
476 | if (tmp == head) | 476 | if (tmp == head) |
477 | break; | 477 | break; |
478 | p = list_entry(tmp, struct mount, mnt.mnt_hash); | 478 | p = list_entry(tmp, struct mount, mnt_hash); |
479 | if (p->mnt.mnt_parent == mnt && p->mnt.mnt_mountpoint == dentry) { | 479 | if (p->mnt.mnt_parent == mnt && p->mnt.mnt_mountpoint == dentry) { |
480 | found = p; | 480 | found = p; |
481 | break; | 481 | break; |
@@ -542,7 +542,7 @@ static void dentry_reset_mounted(struct dentry *dentry) | |||
542 | for (u = 0; u < HASH_SIZE; u++) { | 542 | for (u = 0; u < HASH_SIZE; u++) { |
543 | struct mount *p; | 543 | struct mount *p; |
544 | 544 | ||
545 | list_for_each_entry(p, &mount_hashtable[u], mnt.mnt_hash) { | 545 | list_for_each_entry(p, &mount_hashtable[u], mnt_hash) { |
546 | if (p->mnt.mnt_mountpoint == dentry) | 546 | if (p->mnt.mnt_mountpoint == dentry) |
547 | return; | 547 | return; |
548 | } | 548 | } |
@@ -562,7 +562,7 @@ static void detach_mnt(struct mount *mnt, struct path *old_path) | |||
562 | mnt->mnt.mnt_parent = &mnt->mnt; | 562 | mnt->mnt.mnt_parent = &mnt->mnt; |
563 | mnt->mnt.mnt_mountpoint = mnt->mnt.mnt_root; | 563 | mnt->mnt.mnt_mountpoint = mnt->mnt.mnt_root; |
564 | list_del_init(&mnt->mnt.mnt_child); | 564 | list_del_init(&mnt->mnt.mnt_child); |
565 | list_del_init(&mnt->mnt.mnt_hash); | 565 | list_del_init(&mnt->mnt_hash); |
566 | dentry_reset_mounted(old_path->dentry); | 566 | dentry_reset_mounted(old_path->dentry); |
567 | } | 567 | } |
568 | 568 | ||
@@ -585,7 +585,7 @@ void mnt_set_mountpoint(struct vfsmount *mnt, struct dentry *dentry, | |||
585 | static void attach_mnt(struct mount *mnt, struct path *path) | 585 | static void attach_mnt(struct mount *mnt, struct path *path) |
586 | { | 586 | { |
587 | mnt_set_mountpoint(path->mnt, path->dentry, &mnt->mnt); | 587 | mnt_set_mountpoint(path->mnt, path->dentry, &mnt->mnt); |
588 | list_add_tail(&mnt->mnt.mnt_hash, mount_hashtable + | 588 | list_add_tail(&mnt->mnt_hash, mount_hashtable + |
589 | hash(path->mnt, path->dentry)); | 589 | hash(path->mnt, path->dentry)); |
590 | list_add_tail(&mnt->mnt.mnt_child, &path->mnt->mnt_mounts); | 590 | list_add_tail(&mnt->mnt.mnt_child, &path->mnt->mnt_mounts); |
591 | } | 591 | } |
@@ -625,7 +625,7 @@ static void commit_tree(struct mount *mnt) | |||
625 | 625 | ||
626 | list_splice(&head, n->list.prev); | 626 | list_splice(&head, n->list.prev); |
627 | 627 | ||
628 | list_add_tail(&mnt->mnt.mnt_hash, mount_hashtable + | 628 | list_add_tail(&mnt->mnt_hash, mount_hashtable + |
629 | hash(parent, mnt->mnt.mnt_mountpoint)); | 629 | hash(parent, mnt->mnt.mnt_mountpoint)); |
630 | list_add_tail(&mnt->mnt.mnt_child, &parent->mnt_mounts); | 630 | list_add_tail(&mnt->mnt.mnt_child, &parent->mnt_mounts); |
631 | touch_mnt_namespace(n); | 631 | touch_mnt_namespace(n); |
@@ -1193,8 +1193,8 @@ void release_mounts(struct list_head *head) | |||
1193 | { | 1193 | { |
1194 | struct mount *mnt; | 1194 | struct mount *mnt; |
1195 | while (!list_empty(head)) { | 1195 | while (!list_empty(head)) { |
1196 | mnt = list_first_entry(head, struct mount, mnt.mnt_hash); | 1196 | mnt = list_first_entry(head, struct mount, mnt_hash); |
1197 | list_del_init(&mnt->mnt.mnt_hash); | 1197 | list_del_init(&mnt->mnt_hash); |
1198 | if (mnt_has_parent(&mnt->mnt)) { | 1198 | if (mnt_has_parent(&mnt->mnt)) { |
1199 | struct dentry *dentry; | 1199 | struct dentry *dentry; |
1200 | struct vfsmount *m; | 1200 | struct vfsmount *m; |
@@ -1223,12 +1223,12 @@ void umount_tree(struct vfsmount *mnt, int propagate, struct list_head *kill) | |||
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 = real_mount(mnt); p; p = next_mnt(p, mnt)) |
1226 | list_move(&p->mnt.mnt_hash, &tmp_list); | 1226 | list_move(&p->mnt_hash, &tmp_list); |
1227 | 1227 | ||
1228 | if (propagate) | 1228 | if (propagate) |
1229 | propagate_umount(&tmp_list); | 1229 | propagate_umount(&tmp_list); |
1230 | 1230 | ||
1231 | list_for_each_entry(p, &tmp_list, mnt.mnt_hash) { | 1231 | list_for_each_entry(p, &tmp_list, mnt_hash) { |
1232 | list_del_init(&p->mnt.mnt_expire); | 1232 | list_del_init(&p->mnt.mnt_expire); |
1233 | list_del_init(&p->mnt.mnt_list); | 1233 | list_del_init(&p->mnt.mnt_list); |
1234 | __touch_mnt_namespace(p->mnt.mnt_ns); | 1234 | __touch_mnt_namespace(p->mnt.mnt_ns); |
@@ -1620,8 +1620,8 @@ static int attach_recursive_mnt(struct mount *source_mnt, | |||
1620 | commit_tree(source_mnt); | 1620 | commit_tree(source_mnt); |
1621 | } | 1621 | } |
1622 | 1622 | ||
1623 | list_for_each_entry_safe(child, p, &tree_list, mnt.mnt_hash) { | 1623 | list_for_each_entry_safe(child, p, &tree_list, mnt_hash) { |
1624 | list_del_init(&child->mnt.mnt_hash); | 1624 | list_del_init(&child->mnt_hash); |
1625 | commit_tree(child); | 1625 | commit_tree(child); |
1626 | } | 1626 | } |
1627 | br_write_unlock(vfsmount_lock); | 1627 | br_write_unlock(vfsmount_lock); |
diff --git a/fs/pnode.c b/fs/pnode.c index 916c8e87cf4e..a2f0f3e0e127 100644 --- a/fs/pnode.c +++ b/fs/pnode.c | |||
@@ -247,13 +247,13 @@ int propagate_mnt(struct vfsmount *dest_mnt, struct dentry *dest_dentry, | |||
247 | 247 | ||
248 | if (is_subdir(dest_dentry, m->mnt_root)) { | 248 | if (is_subdir(dest_dentry, m->mnt_root)) { |
249 | mnt_set_mountpoint(m, dest_dentry, &child->mnt); | 249 | mnt_set_mountpoint(m, dest_dentry, &child->mnt); |
250 | list_add_tail(&child->mnt.mnt_hash, tree_list); | 250 | list_add_tail(&child->mnt_hash, tree_list); |
251 | } else { | 251 | } else { |
252 | /* | 252 | /* |
253 | * This can happen if the parent mount was bind mounted | 253 | * This can happen if the parent mount was bind mounted |
254 | * on some subdirectory of a shared/slave mount. | 254 | * on some subdirectory of a shared/slave mount. |
255 | */ | 255 | */ |
256 | list_add_tail(&child->mnt.mnt_hash, &tmp_list); | 256 | list_add_tail(&child->mnt_hash, &tmp_list); |
257 | } | 257 | } |
258 | prev_dest_mnt = m; | 258 | prev_dest_mnt = m; |
259 | prev_src_mnt = &child->mnt; | 259 | prev_src_mnt = &child->mnt; |
@@ -261,7 +261,7 @@ int propagate_mnt(struct vfsmount *dest_mnt, struct dentry *dest_dentry, | |||
261 | out: | 261 | out: |
262 | br_write_lock(vfsmount_lock); | 262 | br_write_lock(vfsmount_lock); |
263 | while (!list_empty(&tmp_list)) { | 263 | while (!list_empty(&tmp_list)) { |
264 | child = list_first_entry(&tmp_list, struct mount, mnt.mnt_hash); | 264 | child = list_first_entry(&tmp_list, struct mount, mnt_hash); |
265 | umount_tree(&child->mnt, 0, &umount_list); | 265 | umount_tree(&child->mnt, 0, &umount_list); |
266 | } | 266 | } |
267 | br_write_unlock(vfsmount_lock); | 267 | br_write_unlock(vfsmount_lock); |
@@ -337,7 +337,7 @@ static void __propagate_umount(struct mount *mnt) | |||
337 | * other children | 337 | * other children |
338 | */ | 338 | */ |
339 | if (child && list_empty(&child->mnt.mnt_mounts)) | 339 | if (child && list_empty(&child->mnt.mnt_mounts)) |
340 | list_move_tail(&child->mnt.mnt_hash, &mnt->mnt.mnt_hash); | 340 | list_move_tail(&child->mnt_hash, &mnt->mnt_hash); |
341 | } | 341 | } |
342 | } | 342 | } |
343 | 343 | ||
@@ -352,7 +352,7 @@ int propagate_umount(struct list_head *list) | |||
352 | { | 352 | { |
353 | struct mount *mnt; | 353 | struct mount *mnt; |
354 | 354 | ||
355 | list_for_each_entry(mnt, list, mnt.mnt_hash) | 355 | list_for_each_entry(mnt, list, mnt_hash) |
356 | __propagate_umount(mnt); | 356 | __propagate_umount(mnt); |
357 | return 0; | 357 | return 0; |
358 | } | 358 | } |
diff --git a/include/linux/mount.h b/include/linux/mount.h index 00f5c4f2160b..77c913dc7397 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -53,7 +53,6 @@ struct mnt_pcp { | |||
53 | }; | 53 | }; |
54 | 54 | ||
55 | struct vfsmount { | 55 | struct vfsmount { |
56 | struct list_head mnt_hash; | ||
57 | struct vfsmount *mnt_parent; /* fs we are mounted on */ | 56 | struct vfsmount *mnt_parent; /* fs we are mounted on */ |
58 | struct dentry *mnt_mountpoint; /* dentry of mountpoint */ | 57 | struct dentry *mnt_mountpoint; /* dentry of mountpoint */ |
59 | struct dentry *mnt_root; /* root of the mounted tree */ | 58 | struct dentry *mnt_root; /* root of the mounted tree */ |