diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2018-07-21 12:05:30 +0300 |
---|---|---|
committer | Kotresh HR <khiremat@redhat.com> | 2018-08-16 04:06:13 +0000 |
commit | 4fe662be4143629e405b1718836be6c990fcebbb (patch) | |
tree | 0f6268b4b9b84c92f8b648fe2fa54ffafb32d9d9 /libglusterfs/src/common-utils.c | |
parent | 4d1ea415f5346b24c13810aab18a24256fb2b41a (diff) |
contrib/xxhash: update to latest xxHash (0.6.5)
Update to latest xxHash, which is supposed to faster with small keys.
Specifically, updated to 3064d42e7d74b0921bdd1818395d9cb37bb8976a,
which is a bit higher than 0.6.5.
Compiled hopefully with namespace (XXH_NAMESPACE=GF_),
which allows to use XXH() funcs with no fear they'll 'leak'
from our library.
Only compile tested!
xxhsum is modified to display messages which was conflicting
with regression tests (TAP harness). So modified the
gfid2path_fuse.t and gfid2path_nfs.t to adhere to that.
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Change-Id: I35cea5cc93f338c1023ac2c9bc6d7d13225a967b
Diffstat (limited to 'libglusterfs/src/common-utils.c')
-rw-r--r-- | libglusterfs/src/common-utils.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 7414691c2c7..543f8601ebe 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -49,6 +49,7 @@ #include "lkowner.h" #include "syscall.h" #include "cli1-xdr.h" +#define XXH_INLINE_ALL #include "xxhash.h" #include <ifaddrs.h> #include "libglusterfs-messages.h" @@ -78,17 +79,17 @@ typedef int32_t (*rw_op_t)(int32_t fd, char *buf, int32_t size); typedef int32_t (*rwv_op_t)(int32_t fd, const struct iovec *buf, int32_t size); void -gf_xxh64_wrapper(const unsigned char *data, size_t len, unsigned long long seed, +gf_xxh64_wrapper(const unsigned char *data, size_t const len, unsigned long long const seed, char *xxh64) { unsigned short i = 0; - unsigned short lim = GF_XXH64_DIGEST_LENGTH*2+1; - GF_XXH64_hash_t hash = 0; - GF_XXH64_canonical_t c_hash = {{0,},}; - const uint8_t *p = (const uint8_t *) &c_hash; + const unsigned short lim = GF_XXH64_DIGEST_LENGTH*2+1; + XXH64_hash_t hash = 0; + XXH64_canonical_t c_hash = {{0,},}; + const uint8_t *p = (const uint8_t *) &c_hash; - hash = GF_XXH64(data, len, seed); - GF_XXH64_canonicalFromHash(&c_hash, hash); + hash = XXH64(data, len, seed); + XXH64_canonicalFromHash(&c_hash, hash); for (i = 0; i < GF_XXH64_DIGEST_LENGTH; i++) snprintf(xxh64 + i * 2, lim-i*2, "%02x", p[i]); |