diff mbox

NFSD: Using path_equal() for checking two paths

Message ID 5505A19C.9020603@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kinglong Mee March 15, 2015, 3:13 p.m. UTC
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(-)

Comments

J. Bruce Fields March 20, 2015, 8:17 p.m. UTC | #1
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
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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