NFSD: Using path_equal() for checking two paths
authorKinglong Mee <kinglongmee@gmail.com>
Sun, 15 Mar 2015 15:13:32 +0000 (23:13 +0800)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 31 Mar 2015 20:46:38 +0000 (16:46 -0400)
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/export.c
fs/nfsd/nfs4xdr.c

index c3e3b6e55ae28d01ee4922b98b021dfd45151e02..2911f519fe646f147ffd72fbca1959c401acba42 100644 (file)
@@ -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)
index 5fb7e78169a6b27a1a5a4d5e9ec354c9e32f6c43..5c0aa74cba86cf4c1ea6c4c76079272689a9220a 100644 (file)
@@ -2020,7 +2020,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))