diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-11-23 19:26:23 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-03 22:52:36 -0500 |
commit | b2dba1af3c4157040303a76d25216b1713d333d0 (patch) | |
tree | c846b1c8074d29b9fc02ef3eeda98631dfd6ee94 /fs/pnode.c | |
parent | aa9c0e07bb90589186f3b5a0ca97660c2cb50806 (diff) | |
download | linux-3.10-b2dba1af3c4157040303a76d25216b1713d333d0.tar.gz linux-3.10-b2dba1af3c4157040303a76d25216b1713d333d0.tar.bz2 linux-3.10-b2dba1af3c4157040303a76d25216b1713d333d0.zip |
vfs: new internal helper: mnt_has_parent(mnt)
vfsmounts have ->mnt_parent pointing either to a different vfsmount
or to itself; it's never NULL and termination condition in loops
traversing the tree towards root is mnt == mnt->mnt_parent. At least
one place (see the next patch) is confused about what's going on;
let's add an explicit helper checking it right way and use it in
all places where we need it. Not that there had been too many,
but...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/pnode.c')
-rw-r--r-- | fs/pnode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/pnode.c b/fs/pnode.c index d42514e3238..f1cd958b92e 100644 --- a/fs/pnode.c +++ b/fs/pnode.c @@ -36,7 +36,7 @@ static inline struct vfsmount *next_slave(struct vfsmount *p) static bool is_path_reachable(struct vfsmount *mnt, struct dentry *dentry, const struct path *root) { - while (mnt != root->mnt && mnt->mnt_parent != mnt) { + while (mnt != root->mnt && mnt_has_parent(mnt)) { dentry = mnt->mnt_mountpoint; mnt = mnt->mnt_parent; } |