summaryrefslogtreecommitdiffstats
path: root/xlators/performance/nl-cache/src/nl-cache.c
diff options
context:
space:
mode:
authorXavier Hernandez <jahernan@redhat.com>2017-11-07 13:45:03 +0100
committerAmar Tumballi <amarts@redhat.com>2017-11-14 05:22:00 +0000
commit3f8d118e48f11f448f35aca0c48ad40e0fd34f5b (patch)
tree8ab76f112fd5323b8820c0b2bf3ac58698981930 /xlators/performance/nl-cache/src/nl-cache.c
parent87d5fb2ca50ab2812eabc7373216c45a5b4d16df (diff)
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 <jahernan@redhat.com>
Diffstat (limited to 'xlators/performance/nl-cache/src/nl-cache.c')
-rw-r--r--xlators/performance/nl-cache/src/nl-cache.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/xlators/performance/nl-cache/src/nl-cache.c b/xlators/performance/nl-cache/src/nl-cache.c
index 7dad8d95a53..9fa7ec87616 100644
--- a/xlators/performance/nl-cache/src/nl-cache.c
+++ b/xlators/performance/nl-cache/src/nl-cache.c
@@ -618,29 +618,29 @@ nlc_priv_dump (xlator_t *this)
gf_proc_dump_add_section(key_prefix);
gf_proc_dump_write("negative_lookup_hit_count", "%"PRId64,
- conf->nlc_counter.nlc_hit.cnt);
+ GF_ATOMIC_GET(conf->nlc_counter.nlc_hit));
gf_proc_dump_write("negative_lookup_miss_count", "%"PRId64,
- conf->nlc_counter.nlc_miss.cnt);
+ GF_ATOMIC_GET(conf->nlc_counter.nlc_miss));
gf_proc_dump_write("get_real_filename_hit_count", "%"PRId64,
- conf->nlc_counter.getrealfilename_hit.cnt);
+ GF_ATOMIC_GET(conf->nlc_counter.getrealfilename_hit));
gf_proc_dump_write("get_real_filename_miss_count", "%"PRId64,
- conf->nlc_counter.getrealfilename_miss.cnt);
+ GF_ATOMIC_GET(conf->nlc_counter.getrealfilename_miss));
gf_proc_dump_write("nameless_lookup_count", "%"PRId64,
- conf->nlc_counter.nameless_lookup.cnt);
+ GF_ATOMIC_GET(conf->nlc_counter.nameless_lookup));
gf_proc_dump_write("inodes_with_positive_dentry_cache", "%"PRId64,
- conf->nlc_counter.pe_inode_cnt.cnt);
+ GF_ATOMIC_GET(conf->nlc_counter.pe_inode_cnt));
gf_proc_dump_write("inodes_with_negative_dentry_cache", "%"PRId64,
- conf->nlc_counter.ne_inode_cnt.cnt);
+ GF_ATOMIC_GET(conf->nlc_counter.ne_inode_cnt));
gf_proc_dump_write("dentry_invalidations_recieved", "%"PRId64,
- conf->nlc_counter.nlc_invals.cnt);
+ GF_ATOMIC_GET(conf->nlc_counter.nlc_invals));
gf_proc_dump_write("cache_limit", "%"PRIu64,
conf->cache_size);
gf_proc_dump_write("consumed_cache_size", "%"PRId64,
- conf->current_cache_size.cnt);
+ GF_ATOMIC_GET(conf->current_cache_size));
gf_proc_dump_write("inode_limit", "%"PRIu64,
conf->inode_limit);
gf_proc_dump_write("consumed_inodes", "%"PRId64,
- conf->refd_inodes.cnt);
+ GF_ATOMIC_GET(conf->refd_inodes));
return 0;
}