Commit 7ec02ef1 authored by Jan Blunck's avatar Jan Blunck Committed by Linus Torvalds

vfs: remove lives_below_in_same_fs()

Remove lives_below_in_same_fs() since is_subdir() from fs/dcache.c is
providing the same functionality.
Signed-off-by: default avatarJan Blunck <jblunck@suse.de>
Acked-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c5c8be3c
...@@ -1176,17 +1176,6 @@ static int mount_is_safe(struct nameidata *nd) ...@@ -1176,17 +1176,6 @@ static int mount_is_safe(struct nameidata *nd)
#endif #endif
} }
static int lives_below_in_same_fs(struct dentry *d, struct dentry *dentry)
{
while (1) {
if (d == dentry)
return 1;
if (d == NULL || d == d->d_parent)
return 0;
d = d->d_parent;
}
}
struct vfsmount *copy_tree(struct vfsmount *mnt, struct dentry *dentry, struct vfsmount *copy_tree(struct vfsmount *mnt, struct dentry *dentry,
int flag) int flag)
{ {
...@@ -1203,7 +1192,7 @@ struct vfsmount *copy_tree(struct vfsmount *mnt, struct dentry *dentry, ...@@ -1203,7 +1192,7 @@ struct vfsmount *copy_tree(struct vfsmount *mnt, struct dentry *dentry,
p = mnt; p = mnt;
list_for_each_entry(r, &mnt->mnt_mounts, mnt_child) { list_for_each_entry(r, &mnt->mnt_mounts, mnt_child) {
if (!lives_below_in_same_fs(r->mnt_mountpoint, dentry)) if (!is_subdir(r->mnt_mountpoint, dentry))
continue; continue;
for (s = r; s; s = next_mnt(s, r)) { for (s = r; s; s = next_mnt(s, r)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment