[PATCH] nfsd: stricter endianness in reply cache hash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Just a dumb patch to make u32/__be32 use more consistent, queuing for
3.7.--b.

commit 46056c57875540e945b9fc84042f2e4d7777b2d3
Author: J. Bruce Fields <bfields@xxxxxxxxxx>
Date:   Fri Jul 27 11:57:00 2012 -0400

    nfsd: stricter endianness in reply cache hash
    
    Admittedly this is just to shut up sparse; the byte-swapping has no
    effect on the result.
    
    Signed-off-by: J. Bruce Fields <bfields@xxxxxxxxxx>

diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index 2cbac34..6e5b8a8 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -29,10 +29,10 @@ static int			cache_disabled = 1;
 /*
  * Calculate the hash index from an XID.
  */
-static inline u32 request_hash(u32 xid)
+static inline u32 request_hash(__be32 xid)
 {
-	u32 h = xid;
-	h ^= (xid >> 24);
+	u32 h = ntohl(xid);
+	h ^= (h >> 24);
 	return h & (HASHSIZE-1);
 }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux