linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NFSD: Using path_equal() for checking two paths
@ 2015-03-15 15:13 Kinglong Mee
  2015-03-20 20:17 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Kinglong Mee @ 2015-03-15 15:13 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Linux NFS Mailing List

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 fs/nfsd/export.c  | 3 +--
 fs/nfsd/nfs4xdr.c | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index c3e3b6e..2911f51 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -691,8 +691,7 @@ static int svc_export_match(struct cache_head *a, struct cache_head *b)
 	struct svc_export *orig = container_of(a, struct svc_export, h);
 	struct svc_export *new = container_of(b, struct svc_export, h);
 	return orig->ex_client == new->ex_client &&
-		orig->ex_path.dentry == new->ex_path.dentry &&
-		orig->ex_path.mnt == new->ex_path.mnt;
+		path_equal(&orig->ex_path, &new->ex_path);
 }
 
 static void svc_export_init(struct cache_head *cnew, struct cache_head *citem)
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index df5e66c..a6a9b90 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2008,7 +2008,7 @@ static __be32 nfsd4_encode_path(struct xdr_stream *xdr,
 	 * dentries/path components in an array.
 	 */
 	for (;;) {
-		if (cur.dentry == root->dentry && cur.mnt == root->mnt)
+		if (path_equal(&cur, root))
 			break;
 		if (cur.dentry == cur.mnt->mnt_root) {
 			if (follow_up(&cur))
-- 
2.3.1


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

* Re: [PATCH] NFSD: Using path_equal() for checking two paths
  2015-03-15 15:13 [PATCH] NFSD: Using path_equal() for checking two paths Kinglong Mee
@ 2015-03-20 20:17 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2015-03-20 20:17 UTC (permalink / raw)
  To: Kinglong Mee; +Cc: Linux NFS Mailing List

Thanks, applying for 4.1.--b.

On Sun, Mar 15, 2015 at 11:13:32PM +0800, Kinglong Mee wrote:
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> ---
>  fs/nfsd/export.c  | 3 +--
>  fs/nfsd/nfs4xdr.c | 2 +-
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> index c3e3b6e..2911f51 100644
> --- a/fs/nfsd/export.c
> +++ b/fs/nfsd/export.c
> @@ -691,8 +691,7 @@ static int svc_export_match(struct cache_head *a, struct cache_head *b)
>  	struct svc_export *orig = container_of(a, struct svc_export, h);
>  	struct svc_export *new = container_of(b, struct svc_export, h);
>  	return orig->ex_client == new->ex_client &&
> -		orig->ex_path.dentry == new->ex_path.dentry &&
> -		orig->ex_path.mnt == new->ex_path.mnt;
> +		path_equal(&orig->ex_path, &new->ex_path);
>  }
>  
>  static void svc_export_init(struct cache_head *cnew, struct cache_head *citem)
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index df5e66c..a6a9b90 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -2008,7 +2008,7 @@ static __be32 nfsd4_encode_path(struct xdr_stream *xdr,
>  	 * dentries/path components in an array.
>  	 */
>  	for (;;) {
> -		if (cur.dentry == root->dentry && cur.mnt == root->mnt)
> +		if (path_equal(&cur, root))
>  			break;
>  		if (cur.dentry == cur.mnt->mnt_root) {
>  			if (follow_up(&cur))
> -- 
> 2.3.1

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

end of thread, other threads:[~2015-03-20 20:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-15 15:13 [PATCH] NFSD: Using path_equal() for checking two paths Kinglong Mee
2015-03-20 20:17 ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).