All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] VFS: Remove lives_below_in_same_fs()
@ 2007-10-12 15:58 Jan Blunck
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Blunck @ 2007-10-12 15:58 UTC (permalink / raw)
  To: Alexander Viro; +Cc: Christoph Hellwig, Linux-Kernel Mailinglist

This is another cleanup which removes lives_below_in_same_fs() since
is_subdir() from fs/dcache.c is providing the same functionality and is more
widespreadly used.

Signed-off-by: Jan Blunck <jblunck@suse.de>
---
 fs/namespace.c |   13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Index: b/fs/namespace.c
===================================================================
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1036,17 +1036,6 @@ static bool permit_mount(struct nameidat
 	return true;
 }
 
-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, uid_t owner)
 {
@@ -1063,7 +1052,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)) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] VFS: Remove lives_below_in_same_fs()
@ 2008-03-14 15:22 Jan Blunck
  2008-03-14 15:51 ` Miklos Szeredi
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Blunck @ 2008-03-14 15:22 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Miklos Szeredi, linux-fsdevel

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>
---
 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)) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] VFS: Remove lives_below_in_same_fs()
  2008-03-14 15:22 [PATCH] VFS: Remove lives_below_in_same_fs() Jan Blunck
@ 2008-03-14 15:51 ` Miklos Szeredi
  0 siblings, 0 replies; 3+ messages in thread
From: Miklos Szeredi @ 2008-03-14 15:51 UTC (permalink / raw)
  To: jblunck; +Cc: akpm, miklos, linux-fsdevel

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

> ---
>  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)) {
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-03-14 15:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-14 15:22 [PATCH] VFS: Remove lives_below_in_same_fs() Jan Blunck
2008-03-14 15:51 ` Miklos Szeredi
  -- strict thread matches above, loose matches on Subject: below --
2007-10-12 15:58 Jan Blunck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.