From 703b5faf22fbddf984a361e6555f3a03fdba63d9 Mon Sep 17 00:00:00 2001 From: George Spelvin Date: Fri, 10 Jun 2016 00:22:12 -0400 Subject: fs/dcache.c: Save one 32-bit multiply in dcache lookup Noe that we're mixing in the parent pointer earlier, we don't need to use hash_32() to mix its bits. Instead, we can just take the msbits of the hash value directly. For those applications which use the partial_name_hash(), move the multiply to end_name_hash. Signed-off-by: George Spelvin Signed-off-by: Linus Torvalds --- fs/dcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/dcache.c') diff --git a/fs/dcache.c b/fs/dcache.c index 9522b8b63871..03f1a332f677 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -106,7 +106,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(hash, d_hash_shift); + return dentry_hashtable + (hash >> (32 - d_hash_shift)); } #define IN_LOOKUP_SHIFT 10 -- cgit v1.2.3