From 3f8d118e48f11f448f35aca0c48ad40e0fd34f5b Mon Sep 17 00:00:00 2001 From: Xavier Hernandez Date: Tue, 7 Nov 2017 13:45:03 +0100 Subject: libglusterfs/atomic: Improved atomic support This patch solves a detection problem in configure.ac that prevented that compilation detects builtin __atomic or __sync functions. It also adds more atomic types and support for other atomic functions. An special case has been added to support 64-bit atomics on 32-bit systems. The solution is to fallback to the mutex solution only for 64-bit atomics, but smaller atomic types will still take advantage of builtins if available. Change-Id: I6b9afc7cd6e66b28a33278715583552872278801 BUG: 1510397 Signed-off-by: Xavier Hernandez --- xlators/performance/md-cache/src/md-cache.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'xlators/performance/md-cache/src/md-cache.c') diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c index 64a2867f5d9..6938b3150a6 100644 --- a/xlators/performance/md-cache/src/md-cache.c +++ b/xlators/performance/md-cache/src/md-cache.c @@ -2628,21 +2628,21 @@ mdc_priv_dump (xlator_t *this) gf_proc_dump_add_section(key_prefix); gf_proc_dump_write("stat_hit_count", "%"PRId64, - conf->mdc_counter.stat_hit.cnt); + GF_ATOMIC_GET(conf->mdc_counter.stat_hit)); gf_proc_dump_write("stat_miss_count", "%"PRId64, - conf->mdc_counter.stat_miss.cnt); + GF_ATOMIC_GET(conf->mdc_counter.stat_miss)); gf_proc_dump_write("xattr_hit_count", "%"PRId64, - conf->mdc_counter.xattr_hit.cnt); + GF_ATOMIC_GET(conf->mdc_counter.xattr_hit)); gf_proc_dump_write("xattr_miss_count", "%"PRId64, - conf->mdc_counter.xattr_miss.cnt); + GF_ATOMIC_GET(conf->mdc_counter.xattr_miss)); gf_proc_dump_write("nameless_lookup_count", "%"PRId64, - conf->mdc_counter.nameless_lookup.cnt); + GF_ATOMIC_GET(conf->mdc_counter.nameless_lookup)); gf_proc_dump_write("negative_lookup_count", "%"PRId64, - conf->mdc_counter.negative_lookup.cnt); + GF_ATOMIC_GET(conf->mdc_counter.negative_lookup)); gf_proc_dump_write("stat_invalidations_received", "%"PRId64, - conf->mdc_counter.stat_invals.cnt); + GF_ATOMIC_GET(conf->mdc_counter.stat_invals)); gf_proc_dump_write("xattr_invalidations_received", "%"PRId64, - conf->mdc_counter.xattr_invals.cnt); + GF_ATOMIC_GET(conf->mdc_counter.xattr_invals)); return 0; } -- cgit