From: "J. Bruce Fields" <bfields@fieldses.org>
To: linux-nfs@vger.kernel.org
Subject: [PATCH] nfsd: stricter endianness in reply cache hash
Date: Mon, 1 Oct 2012 13:35:14 -0400 [thread overview]
Message-ID: <20121001173513.GA29803@fieldses.org> (raw)
Just a dumb patch to make u32/__be32 use more consistent, queuing for
3.7.--b.
commit 46056c57875540e945b9fc84042f2e4d7777b2d3
Author: J. Bruce Fields <bfields@redhat.com>
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@redhat.com>
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);
}
reply other threads:[~2012-10-01 17:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121001173513.GA29803@fieldses.org \
--to=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).