diff mbox

[1/2] dcache: subtract d_hash_shift from 32 in advance

Message ID 20171120150507.GA5832@avx2 (mailing list archive)
State New, archived
Headers show

Commit Message

Alexey Dobriyan Nov. 20, 2017, 3:05 p.m. UTC
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 fs/dcache.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

--- 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 */