aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-11-23 19:34:49 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-03 22:52:36 -0500
commitafac7cba7ed31968a95e181dc25e204e45009ea8 (patch)
tree282cf7da6bc3915093df622ebfcd39f44f6fd1cd /fs/dcache.c
parentb2dba1af3c4157040303a76d25216b1713d333d0 (diff)
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.c25
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)
2853 return result; 2853 return result;
2854} 2854}
2855 2855
2856int path_is_under(struct path *path1, struct path *path2)
2857{
2858 struct vfsmount *mnt = path1->mnt;
2859 struct dentry *dentry = path1->dentry;
2860 int res;
2861
2862 br_read_lock(vfsmount_lock);
2863 if (mnt != path2->mnt) {
2864 for (;;) {
2865 if (!mnt_has_parent(mnt)) {
2866 br_read_unlock(vfsmount_lock);
2867 return 0;
2868 }
2869 if (mnt->mnt_parent == path2->mnt)
2870 break;
2871 mnt = mnt->mnt_parent;
2872 }
2873 dentry = mnt->mnt_mountpoint;
2874 }
2875 res = is_subdir(dentry, path2->dentry);
2876 br_read_unlock(vfsmount_lock);
2877 return res;
2878}
2879EXPORT_SYMBOL(path_is_under);
2880
2881void d_genocide(struct dentry *root) 2856void d_genocide(struct dentry *root)
2882{ 2857{
2883 struct dentry *this_parent; 2858 struct dentry *this_parent;