summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
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,