From patchwork Mon Oct 1 17:35:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Bruce Fields" X-Patchwork-Id: 1531981 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 04B8E3FE80 for ; Mon, 1 Oct 2012 17:35:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751556Ab2JARfP (ORCPT ); Mon, 1 Oct 2012 13:35:15 -0400 Received: from fieldses.org ([174.143.236.118]:49156 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751551Ab2JARfO (ORCPT ); Mon, 1 Oct 2012 13:35:14 -0400 Received: from bfields by fieldses.org with local (Exim 4.76) (envelope-from ) id 1TIjti-0007lV-4S for linux-nfs@vger.kernel.org; Mon, 01 Oct 2012 13:35:14 -0400 Date: Mon, 1 Oct 2012 13:35:14 -0400 To: linux-nfs@vger.kernel.org Subject: [PATCH] nfsd: stricter endianness in reply cache hash Message-ID: <20121001173513.GA29803@fieldses.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) From: "J. Bruce Fields" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Just a dumb patch to make u32/__be32 use more consistent, queuing for 3.7.--b. commit 46056c57875540e945b9fc84042f2e4d7777b2d3 Author: J. Bruce Fields 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 --- 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 --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); }