Skip to content

Commit 854d3e6

Browse files
Alexey DobriyanAl Viro
authored andcommitted
dcache: subtract d_hash_shift from 32 in advance
Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent 01950a3 commit 854d3e6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/dcache.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static struct hlist_bl_head *dentry_hashtable __read_mostly;
110110

111111
static inline struct hlist_bl_head *d_hash(unsigned int hash)
112112
{
113-
return dentry_hashtable + (hash >> (32 - d_hash_shift));
113+
return dentry_hashtable + (hash >> d_hash_shift);
114114
}
115115

116116
#define IN_LOOKUP_SHIFT 10
@@ -3593,6 +3593,7 @@ static void __init dcache_init_early(void)
35933593
&d_hash_mask,
35943594
0,
35953595
0);
3596+
d_hash_shift = 32 - d_hash_shift;
35963597
}
35973598

35983599
static void __init dcache_init(void)
@@ -3619,6 +3620,7 @@ static void __init dcache_init(void)
36193620
&d_hash_mask,
36203621
0,
36213622
0);
3623+
d_hash_shift = 32 - d_hash_shift;
36223624
}
36233625

36243626
/* SLAB cache for __getname() consumers */

0 commit comments

Comments
 (0)