aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rhashtable.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rhashtable.c')
-rw-r--r--lib/rhashtable.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index 97ee2a5b77fc..587fd42f3073 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -24,6 +24,7 @@
#include <linux/vmalloc.h>
#include <linux/mm.h>
#include <linux/jhash.h>
+#include <linux/siphash.h>
#include <linux/random.h>
#include <linux/rhashtable.h>
#include <linux/err.h>
@@ -988,6 +989,14 @@ u32 rhashtable_jhash2(const void *key, u32 length, struct rhash_rnd seed)
}
EXPORT_SYMBOL_GPL(rhashtable_jhash2);
+u32 rhashtable_siphash(const void *key, u32 length, struct rhash_rnd seed)
+{
+ BUILD_BUG_ON(sizeof(seed) < sizeof(siphash_key_t));
+
+ return siphash(key, length, (siphash_key_t *)&seed);
+}
+EXPORT_SYMBOL_GPL(rhashtable_siphash);
+
/**
* rhashtable_init - initialize a new hash table
* @ht: hash table to be initialized