Whamcloud - gitweb
LU-16518 misc: use fixed hash code
[fs/lustre-release.git] / libcfs / include / libcfs / linux / linux-hash.h
index 3c615bd..c7a04bc 100644 (file)
@@ -59,10 +59,20 @@ static __always_inline u32 cfs_hash_64(u64 val, unsigned int bits)
        return cfs_hash_32(((u32)val ^ ((val >> 32) * GOLDEN_RATIO_32)), bits);
 #endif
 }
+
+#if BITS_PER_LONG == 32
+#define cfs_hash_long(val, bits) cfs_hash_32(val, bits)
+#elif BITS_PER_LONG == 64
+#define cfs_hash_long(val, bits) cfs_hash_64(val, bits)
+#else
+#error Wordsize not 32 or 64
+#endif
+
 #else
 
-#define cfs_hash_32    hash_32
-#define cfs_hash_64    hash_64
+#define cfs_hash_32 hash_32
+#define cfs_hash_64 hash_64
+#define cfs_hash_long hash_long
 
 #endif /* HAVE_BROKEN_HASH_64 */