diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-11-24 18:22:03 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-03 22:56:58 -0500 |
commit | c71053659e3bb27d44b79da0bb4abf5838c2060a (patch) | |
tree | 59e86cc1602db35ffc2c3991953161f1619706b1 /fs/namespace.c | |
parent | 7d6fec45a5131918b51dcd76da52f2ec86a85be6 (diff) |
vfs: spread struct mount - __lookup_mnt() result
switch __lookup_mnt() to returning struct mount *; callers adjusted.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r-- | fs/namespace.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index dda47fee6fdf..398eb2421494 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -464,20 +464,20 @@ static void free_vfsmnt(struct vfsmount *mnt) | |||
464 | * @dir. If @dir is set return the first mount else return the last mount. | 464 | * @dir. If @dir is set return the first mount else return the last mount. |
465 | * vfsmount_lock must be held for read or write. | 465 | * vfsmount_lock must be held for read or write. |
466 | */ | 466 | */ |
467 | struct vfsmount *__lookup_mnt(struct vfsmount *mnt, struct dentry *dentry, | 467 | struct mount *__lookup_mnt(struct vfsmount *mnt, struct dentry *dentry, |
468 | int dir) | 468 | int dir) |
469 | { | 469 | { |
470 | struct list_head *head = mount_hashtable + hash(mnt, dentry); | 470 | struct list_head *head = mount_hashtable + hash(mnt, dentry); |
471 | struct list_head *tmp = head; | 471 | struct list_head *tmp = head; |
472 | struct vfsmount *p, *found = NULL; | 472 | struct mount *p, *found = NULL; |
473 | 473 | ||
474 | for (;;) { | 474 | for (;;) { |
475 | tmp = dir ? tmp->next : tmp->prev; | 475 | tmp = dir ? tmp->next : tmp->prev; |
476 | p = NULL; | 476 | p = NULL; |
477 | if (tmp == head) | 477 | if (tmp == head) |
478 | break; | 478 | break; |
479 | p = list_entry(tmp, struct vfsmount, mnt_hash); | 479 | p = list_entry(tmp, struct mount, mnt.mnt_hash); |
480 | if (p->mnt_parent == mnt && p->mnt_mountpoint == dentry) { | 480 | if (p->mnt.mnt_parent == mnt && p->mnt.mnt_mountpoint == dentry) { |
481 | found = p; | 481 | found = p; |
482 | break; | 482 | break; |
483 | } | 483 | } |
@@ -491,13 +491,18 @@ struct vfsmount *__lookup_mnt(struct vfsmount *mnt, struct dentry *dentry, | |||
491 | */ | 491 | */ |
492 | struct vfsmount *lookup_mnt(struct path *path) | 492 | struct vfsmount *lookup_mnt(struct path *path) |
493 | { | 493 | { |
494 | struct vfsmount *child_mnt; | 494 | struct mount *child_mnt; |
495 | 495 | ||
496 | br_read_lock(vfsmount_lock); | 496 | br_read_lock(vfsmount_lock); |
497 | if ((child_mnt = __lookup_mnt(path->mnt, path->dentry, 1))) | 497 | child_mnt = __lookup_mnt(path->mnt, path->dentry, 1); |
498 | mntget(child_mnt); | 498 | if (child_mnt) { |
499 | br_read_unlock(vfsmount_lock); | 499 | mnt_add_count(child_mnt, 1); |
500 | return child_mnt; | 500 | br_read_unlock(vfsmount_lock); |
501 | return &child_mnt->mnt; | ||
502 | } else { | ||
503 | br_read_unlock(vfsmount_lock); | ||
504 | return NULL; | ||
505 | } | ||
501 | } | 506 | } |
502 | 507 | ||
503 | static inline int check_mnt(struct vfsmount *mnt) | 508 | static inline int check_mnt(struct vfsmount *mnt) |