summaryrefslogtreecommitdiff
path: root/crc
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-09-27 08:38:42 -0600
committerJens Axboe <axboe@fb.com>2014-09-27 08:38:42 -0600
commit9f0e365d0d08f9df142d48bd891370dc50148d5f (patch)
tree7c7c4ef365fad6be49e281042b9cc7b70e90fe3d /crc
parent179b3ead1d98681ea336209af36938a945b24937 (diff)
downloadfio-9f0e365d0d08f9df142d48bd891370dc50148d5f.tar.gz
fio-9f0e365d0d08f9df142d48bd891370dc50148d5f.tar.bz2
Add murmurhash3
And use it in bloom, add it to the crc tester as well. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'crc')
-rw-r--r--crc/test.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/crc/test.c b/crc/test.c
index 36054e6c..95f1c2e7 100644
--- a/crc/test.c
+++ b/crc/test.c
@@ -17,6 +17,7 @@
#include "../crc/sha256.h"
#include "../crc/sha512.h"
#include "../crc/xxhash.h"
+#include "../lib/murmur3.h"
#include "test.h"
@@ -40,6 +41,7 @@ enum {
T_SHA256 = 1U << 7,
T_SHA512 = 1U << 8,
T_XXHASH = 1U << 9,
+ T_MURMUR3 = 1U << 10,
};
static void t_md5(void *buf, size_t size)
@@ -134,6 +136,14 @@ static void t_sha512(void *buf, size_t size)
fio_sha512_update(&ctx, buf, size);
}
+static void t_murmur3(void *buf, size_t size)
+{
+ int i;
+
+ for (i = 0; i < NR_CHUNKS; i++)
+ murmurhash3(buf, size, 0x8989);
+}
+
static void t_xxhash(void *buf, size_t size)
{
void *state;
@@ -199,6 +209,11 @@ static struct test_type t[] = {
.fn = t_xxhash,
},
{
+ .name = "murmur3",
+ .mask = T_MURMUR3,
+ .fn = t_murmur3,
+ },
+ {
.name = NULL,
},
};