Skip to content

Commit

Permalink
vfs: remove lives_below_in_same_fs()
Browse files Browse the repository at this point in the history
Remove lives_below_in_same_fs() since is_subdir() from fs/dcache.c is
providing the same functionality.

Signed-off-by: Jan Blunck <jblunck@suse.de>
Acked-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jan Blunck authored and Linus Torvalds committed Apr 29, 2008
1 parent c5c8be3 commit 7ec02ef
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1176,17 +1176,6 @@ static int mount_is_safe(struct nameidata *nd)
#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,
int flag)
{
Expand All @@ -1203,7 +1192,7 @@ struct vfsmount *copy_tree(struct vfsmount *mnt, struct dentry *dentry,

p = mnt;
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;

for (s = r; s; s = next_mnt(s, r)) {
Expand Down

0 comments on commit 7ec02ef

Please sign in to comment.