1 #ifndef _LINUX_HASH_WRAPPER_H
2 #define _LINUX_HASH_WRAPPER_H
4 #include_next <linux/hash.h>
6 #include <linux/version.h>
7 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)
10 struct fast_hash_ops {
11 u32 (*hash)(const void *data, u32 len, u32 seed);
12 u32 (*hash2)(const u32 *data, u32 len, u32 seed);
16 * arch_fast_hash - Caclulates a hash over a given buffer that can have
17 * arbitrary size. This function will eventually use an
18 * architecture-optimized hashing implementation if
19 * available, and trades off distribution for speed.
21 * @data: buffer to hash
22 * @len: length of buffer in bytes
27 extern u32 arch_fast_hash(const void *data, u32 len, u32 seed);
30 * arch_fast_hash2 - Caclulates a hash over a given buffer that has a
31 * size that is of a multiple of 32bit words. This
32 * function will eventually use an architecture-
33 * optimized hashing implementation if available,
34 * and trades off distribution for speed.
36 * @data: buffer to hash (must be 32bit padded)
37 * @len: number of 32bit words
42 extern u32 arch_fast_hash2(const u32 *data, u32 len, u32 seed);
45 #endif /* _LINUX_HASH_WRAPPER_H */