summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2018-07-21 12:05:30 +0300
committerKotresh HR <khiremat@redhat.com>2018-08-16 04:06:13 +0000
commit4fe662be4143629e405b1718836be6c990fcebbb (patch)
tree0f6268b4b9b84c92f8b648fe2fa54ffafb32d9d9 /libglusterfs
parent4d1ea415f5346b24c13810aab18a24256fb2b41a (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')
-rw-r--r--libglusterfs/src/Makefile.am1
-rw-r--r--libglusterfs/src/common-utils.c15
-rw-r--r--libglusterfs/src/common-utils.h4
3 files changed, 11 insertions, 9 deletions
diff --git a/libglusterfs/src/Makefile.am b/libglusterfs/src/Makefile.am
index c7cd3d5e6fc..92521cc44d1 100644
--- a/libglusterfs/src/Makefile.am
+++ b/libglusterfs/src/Makefile.am
@@ -6,6 +6,7 @@ libglusterfs_la_CFLAGS = $(GF_CFLAGS) $(GF_DARWIN_LIBGLUSTERFS_CFLAGS) \
libglusterfs_la_CPPFLAGS = $(GF_CPPFLAGS) -D__USE_FILE_OFFSET64 \
-DXLATORDIR=\"$(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator\" \
-DXLATORPARENTDIR=\"$(libdir)/glusterfs/$(PACKAGE_VERSION)\" \
+ -DXXH_NAMESPACE=GF_ \
-I$(top_srcdir)/rpc/xdr/src/ -I$(top_builddir)/rpc/xdr/src/ \
-I$(top_srcdir)/rpc/rpc-lib/src/ -I$(CONTRIBDIR)/rbtree \
-I$(CONTRIBDIR)/libexecinfo ${ARGP_STANDALONE_CPPFLAGS} \
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]);
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h
index 3217c16a82e..55ef916ddf7 100644
--- a/libglusterfs/src/common-utils.h
+++ b/libglusterfs/src/common-utils.h
@@ -857,8 +857,8 @@ gf_ports_reserved (char *blocked_port, unsigned char *ports, uint32_t ceiling);
int gf_get_hostname_from_ip (char *client_ip, char **hostname);
gf_boolean_t gf_is_local_addr (char *hostname);
gf_boolean_t gf_is_same_address (char *host1, char *host2);
-void gf_xxh64_wrapper(const unsigned char *data, size_t len,
- unsigned long long seed, char *xxh64);
+void gf_xxh64_wrapper(const unsigned char *data, size_t const len,
+ unsigned long long const seed, char *xxh64);
int gf_set_timestamp (const char *src, const char* dest);
int gf_thread_create (pthread_t *thread, const pthread_attr_t *attr,