Whamcloud - gitweb
b=20581 MDS returns full hash for readdir to decrease hash collision
[fs/lustre-release.git] / lustre / include / lustre_lite.h
index cb0e730..ac71d69 100644 (file)
@@ -150,9 +150,14 @@ static inline void ll_dir_chain_fini(struct ll_dir_chain *chain)
 {
 }
 
-static inline unsigned long hash_x_index(unsigned long value)
+static inline unsigned long hash_x_index(__u64 hash)
 {
-        return ~0UL - value;
+#ifdef __KERNEL__
+# if BITS_PER_LONG == 32
+        hash >>= 32;
+# endif
+#endif
+        return ~0UL - hash;
 }
 
 /** @} lite */