diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-11-23 19:34:49 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-03 22:52:36 -0500 |
commit | afac7cba7ed31968a95e181dc25e204e45009ea8 (patch) | |
tree | 282cf7da6bc3915093df622ebfcd39f44f6fd1cd /fs/dcache.c | |
parent | b2dba1af3c4157040303a76d25216b1713d333d0 (diff) | |
download | linux-rpi3-afac7cba7ed31968a95e181dc25e204e45009ea8.tar.gz linux-rpi3-afac7cba7ed31968a95e181dc25e204e45009ea8.tar.bz2 linux-rpi3-afac7cba7ed31968a95e181dc25e204e45009ea8.zip |
vfs: more mnt_parent cleanups
a) mount --move is checking that ->mnt_parent is non-NULL before
looking if that parent happens to be shared; ->mnt_parent is never
NULL and it's not even an misspelled !mnt_has_parent()
b) pivot_root open-codes is_path_reachable(), poorly.
c) so does path_is_under(), while we are at it.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r-- | fs/dcache.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 8a75e3b0f49d..64c8ce4c147f 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2853,31 +2853,6 @@ int is_subdir(struct dentry *new_dentry, struct dentry *old_dentry) return result; } -int path_is_under(struct path *path1, struct path *path2) -{ - struct vfsmount *mnt = path1->mnt; - struct dentry *dentry = path1->dentry; - int res; - - br_read_lock(vfsmount_lock); - if (mnt != path2->mnt) { - for (;;) { - if (!mnt_has_parent(mnt)) { - br_read_unlock(vfsmount_lock); - return 0; - } - if (mnt->mnt_parent == path2->mnt) - break; - mnt = mnt->mnt_parent; - } - dentry = mnt->mnt_mountpoint; - } - res = is_subdir(dentry, path2->dentry); - br_read_unlock(vfsmount_lock); - return res; -} -EXPORT_SYMBOL(path_is_under); - void d_genocide(struct dentry *root) { struct dentry *this_parent; |