]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/dcache.c
Merge branch 'dma-buf-merge' of git://people.freedesktop.org/~airlied/linux
[karo-tx-linux.git] / fs / dcache.c
index 8a75e3b0f49dab3e0be51000cc9aedf937647483..9791b1e7eee467cb97f243c6311e5624944b38db 100644 (file)
@@ -2452,6 +2452,7 @@ static int prepend_path(const struct path *path,
 {
        struct dentry *dentry = path->dentry;
        struct vfsmount *vfsmnt = path->mnt;
+       struct mount *mnt = real_mount(vfsmnt);
        bool slash = false;
        int error = 0;
 
@@ -2461,10 +2462,11 @@ static int prepend_path(const struct path *path,
 
                if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) {
                        /* Global root? */
-                       if (!mnt_has_parent(vfsmnt))
+                       if (!mnt_has_parent(mnt))
                                goto global_root;
-                       dentry = vfsmnt->mnt_mountpoint;
-                       vfsmnt = vfsmnt->mnt_parent;
+                       dentry = mnt->mnt_mountpoint;
+                       mnt = mnt->mnt_parent;
+                       vfsmnt = &mnt->mnt;
                        continue;
                }
                parent = dentry->d_parent;
@@ -2501,7 +2503,7 @@ global_root:
        if (!slash)
                error = prepend(buffer, buflen, "/", 1);
        if (!error)
-               error = vfsmnt->mnt_ns ? 1 : 2;
+               error = real_mount(vfsmnt)->mnt_ns ? 1 : 2;
        goto out;
 }
 
@@ -2853,31 +2855,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;