vfs: fix bad hashing of dentries
[firefly-linux-kernel-4.4.55.git] / fs / dcache.c
index f867c53a798934af11418ed334766d63c6008556..25c0a1b5f6c0ecab691c8081f1f282dacb44175a 100644 (file)
@@ -106,8 +106,7 @@ static inline struct hlist_bl_head *d_hash(const struct dentry *parent,
                                        unsigned int hash)
 {
        hash += (unsigned long) parent / L1_CACHE_BYTES;
-       hash = hash + (hash >> d_hash_shift);
-       return dentry_hashtable + (hash & d_hash_mask);
+       return dentry_hashtable + hash_32(hash, d_hash_shift);
 }
 
 /* Statistics gathering. */