From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com ([209.85.128.194]:46963 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751309AbdKTPFM (ORCPT ); Mon, 20 Nov 2017 10:05:12 -0500 Received: by mail-wr0-f194.google.com with SMTP id r2so1901714wra.13 for ; Mon, 20 Nov 2017 07:05:11 -0800 (PST) Date: Mon, 20 Nov 2017 18:05:07 +0300 From: Alexey Dobriyan To: viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org Subject: [PATCH 1/2] dcache: subtract d_hash_shift from 32 in advance Message-ID: <20171120150507.GA5832@avx2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Signed-off-by: Alexey Dobriyan --- fs/dcache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/dcache.c +++ b/fs/dcache.c @@ -111,7 +111,7 @@ static struct hlist_bl_head *dentry_hashtable __read_mostly; static inline struct hlist_bl_head *d_hash(unsigned int hash) { - return dentry_hashtable + (hash >> (32 - d_hash_shift)); + return dentry_hashtable + (hash >> d_hash_shift); } #define IN_LOOKUP_SHIFT 10 @@ -3592,6 +3592,7 @@ static void __init dcache_init_early(void) &d_hash_mask, 0, 0); + d_hash_shift = 32 - d_hash_shift; } static void __init dcache_init(void) @@ -3618,6 +3619,7 @@ static void __init dcache_init(void) &d_hash_mask, 0, 0); + d_hash_shift = 32 - d_hash_shift; } /* SLAB cache for __getname() consumers */