OSDN Git Service

dcache: subtract d_hash_shift from 32 in advance
authorAlexey Dobriyan <adobriyan@gmail.com>
Mon, 20 Nov 2017 15:05:07 +0000 (18:05 +0300)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 26 Jan 2018 00:34:29 +0000 (19:34 -0500)
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/dcache.c

index 17e6b84..d4f5b52 100644 (file)
@@ -110,7 +110,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
@@ -3593,6 +3593,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)
@@ -3619,6 +3620,7 @@ static void __init dcache_init(void)
                                        &d_hash_mask,
                                        0,
                                        0);
+       d_hash_shift = 32 - d_hash_shift;
 }
 
 /* SLAB cache for __getname() consumers */