From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Blunck Subject: [PATCH] VFS: Remove lives_below_in_same_fs() Date: Fri, 14 Mar 2008 16:22:38 +0100 Message-ID: <20080314152238.GC27730@T61> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Miklos Szeredi , linux-fsdevel@vger.kernel.org To: Andrew Morton Return-path: Received: from charybdis-ext.suse.de ([195.135.221.2]:56732 "EHLO emea5-mh.id5.novell.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751131AbYCNPWu (ORCPT ); Fri, 14 Mar 2008 11:22:50 -0400 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Remove lives_below_in_same_fs() since is_subdir() from fs/dcache.c is providing the same functionality. Signed-off-by: Jan Blunck --- fs/namespace.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) Index: b/fs/namespace.c =================================================================== --- a/fs/namespace.c +++ b/fs/namespace.c @@ -729,17 +729,6 @@ static int mount_is_safe(struct nameidat #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) { @@ -756,7 +745,7 @@ struct vfsmount *copy_tree(struct vfsmou 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)) {