summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-11-25 04:19:58 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-04 04:57:05 +0100
commit0714a533805a0f8ebfc6fdb6bda9f129b8c7c6d7 (patch)
tree7f34ceedc12c4a680ca3509562b09ec441a0954f /fs/namei.c
parentvfs: mnt_parent moved to struct mount (diff)
downloadlinux-0714a533805a0f8ebfc6fdb6bda9f129b8c7c6d7.tar.xz
linux-0714a533805a0f8ebfc6fdb6bda9f129b8c7c6d7.zip
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.c24
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)
static int follow_up_rcu(struct path *path)
{
- struct vfsmount *parent;
+ struct mount *mnt = real_mount(path->mnt);
+ struct mount *parent;
struct dentry *mountpoint;
- parent = real_mount(path->mnt)->mnt_parent;
- if (parent == path->mnt)
+ parent = mnt->mnt_parent;
+ if (&parent->mnt == path->mnt)
return 0;
- mountpoint = path->mnt->mnt_mountpoint;
+ mountpoint = mnt->mnt.mnt_mountpoint;
path->dentry = mountpoint;
- path->mnt = parent;
+ path->mnt = &parent->mnt;
return 1;
}
int follow_up(struct path *path)
{
- struct vfsmount *parent;
+ struct mount *mnt = real_mount(path->mnt);
+ struct mount *parent;
struct dentry *mountpoint;
br_read_lock(vfsmount_lock);
- parent = real_mount(path->mnt)->mnt_parent;
- if (parent == path->mnt) {
+ parent = mnt->mnt_parent;
+ if (&parent->mnt == path->mnt) {
br_read_unlock(vfsmount_lock);
return 0;
}
- mntget(parent);
- mountpoint = dget(path->mnt->mnt_mountpoint);
+ mntget(&parent->mnt);
+ mountpoint = dget(mnt->mnt.mnt_mountpoint);
br_read_unlock(vfsmount_lock);
dput(path->dentry);
path->dentry = mountpoint;
mntput(path->mnt);
- path->mnt = parent;
+ path->mnt = &parent->mnt;
return 1;
}