diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-11-24 22:19:58 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-03 22:57:05 -0500 |
commit | 0714a533805a0f8ebfc6fdb6bda9f129b8c7c6d7 (patch) | |
tree | 7f34ceedc12c4a680ca3509562b09ec441a0954f /fs/namei.c | |
parent | 3376f34fff5be9954fd9a9c4fd68f4a0a36d480e (diff) |
vfs: now it can be done - make mnt_parent point to struct mount
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/fs/namei.c b/fs/namei.c index 89248bf1b906..2e9110a37c0e 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -677,36 +677,38 @@ follow_link(struct path *link, struct nameidata *nd, void **p) | |||
677 | 677 | ||
678 | static int follow_up_rcu(struct path *path) | 678 | static int follow_up_rcu(struct path *path) |
679 | { | 679 | { |
680 | struct vfsmount *parent; | 680 | struct mount *mnt = real_mount(path->mnt); |
681 | struct mount *parent; | ||
681 | struct dentry *mountpoint; | 682 | struct dentry *mountpoint; |
682 | 683 | ||
683 | parent = real_mount(path->mnt)->mnt_parent; | 684 | parent = mnt->mnt_parent; |
684 | if (parent == path->mnt) | 685 | if (&parent->mnt == path->mnt) |
685 | return 0; | 686 | return 0; |
686 | mountpoint = path->mnt->mnt_mountpoint; | 687 | mountpoint = mnt->mnt.mnt_mountpoint; |
687 | path->dentry = mountpoint; | 688 | path->dentry = mountpoint; |
688 | path->mnt = parent; | 689 | path->mnt = &parent->mnt; |
689 | return 1; | 690 | return 1; |
690 | } | 691 | } |
691 | 692 | ||
692 | int follow_up(struct path *path) | 693 | int follow_up(struct path *path) |
693 | { | 694 | { |
694 | struct vfsmount *parent; | 695 | struct mount *mnt = real_mount(path->mnt); |
696 | struct mount *parent; | ||
695 | struct dentry *mountpoint; | 697 | struct dentry *mountpoint; |
696 | 698 | ||
697 | br_read_lock(vfsmount_lock); | 699 | br_read_lock(vfsmount_lock); |
698 | parent = real_mount(path->mnt)->mnt_parent; | 700 | parent = mnt->mnt_parent; |
699 | if (parent == path->mnt) { | 701 | if (&parent->mnt == path->mnt) { |
700 | br_read_unlock(vfsmount_lock); | 702 | br_read_unlock(vfsmount_lock); |
701 | return 0; | 703 | return 0; |
702 | } | 704 | } |
703 | mntget(parent); | 705 | mntget(&parent->mnt); |
704 | mountpoint = dget(path->mnt->mnt_mountpoint); | 706 | mountpoint = dget(mnt->mnt.mnt_mountpoint); |
705 | br_read_unlock(vfsmount_lock); | 707 | br_read_unlock(vfsmount_lock); |
706 | dput(path->dentry); | 708 | dput(path->dentry); |
707 | path->dentry = mountpoint; | 709 | path->dentry = mountpoint; |
708 | mntput(path->mnt); | 710 | mntput(path->mnt); |
709 | path->mnt = parent; | 711 | path->mnt = &parent->mnt; |
710 | return 1; | 712 | return 1; |
711 | } | 713 | } |
712 | 714 | ||