Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 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>

authored by

Jan Blunck and committed by
Linus Torvalds
7ec02ef1 c5c8be3c

+1 -12
+1 -12
fs/namespace.c
··· 1176 1176 #endif 1177 1177 } 1178 1178 1179 - static int lives_below_in_same_fs(struct dentry *d, struct dentry *dentry) 1180 - { 1181 - while (1) { 1182 - if (d == dentry) 1183 - return 1; 1184 - if (d == NULL || d == d->d_parent) 1185 - return 0; 1186 - d = d->d_parent; 1187 - } 1188 - } 1189 - 1190 1179 struct vfsmount *copy_tree(struct vfsmount *mnt, struct dentry *dentry, 1191 1180 int flag) 1192 1181 { ··· 1192 1203 1193 1204 p = mnt; 1194 1205 list_for_each_entry(r, &mnt->mnt_mounts, mnt_child) { 1195 - if (!lives_below_in_same_fs(r->mnt_mountpoint, dentry)) 1206 + if (!is_subdir(r->mnt_mountpoint, dentry)) 1196 1207 continue; 1197 1208 1198 1209 for (s = r; s; s = next_mnt(s, r)) {