diff options
author | Mohit Agrawal <moagrawal@redhat.com> | 2018-12-10 11:14:04 +0530 |
---|---|---|
committer | Xavi Hernandez <xhernandez@redhat.com> | 2019-01-15 11:52:22 +0000 |
commit | 2261e444a47ffffb5d64305efceee1d5a734cd75 (patch) | |
tree | 06f85f6e3f4ba6c81a62347ad6b4102f6ec2f847 /xlators/storage/posix/src/posix-common.c | |
parent | f578cdad23d8a8428a7012f777f4987507f19ea4 (diff) |
posix: Convert several posix_private members to gf_atomic
Change-Id: I629698d8ddf6f15428880bdc1501d36bc37b8ebb
fixes: bz#1657607
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix-common.c')
-rw-r--r-- | xlators/storage/posix/src/posix-common.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/xlators/storage/posix/src/posix-common.c b/xlators/storage/posix/src/posix-common.c index af80f28214b..961b6e871eb 100644 --- a/xlators/storage/posix/src/posix-common.c +++ b/xlators/storage/posix/src/posix-common.c @@ -125,9 +125,10 @@ posix_priv(xlator_t *this) gf_proc_dump_write("base_path", "%s", priv->base_path); gf_proc_dump_write("base_path_length", "%d", priv->base_path_length); - gf_proc_dump_write("max_read", "%" PRId64, priv->read_value); - gf_proc_dump_write("max_write", "%" PRId64, priv->write_value); - gf_proc_dump_write("nr_files", "%" PRId64, priv->nr_files); + gf_proc_dump_write("max_read", "%" PRId64, GF_ATOMIC_GET(priv->read_value)); + gf_proc_dump_write("max_write", "%" PRId64, + GF_ATOMIC_GET(priv->write_value)); + gf_proc_dump_write("nr_files", "%ld", GF_ATOMIC_GET(priv->nr_files)); return 0; } @@ -775,6 +776,9 @@ posix_init(xlator_t *this) } LOCK_INIT(&_private->lock); + GF_ATOMIC_INIT(_private->nr_files, 0); + GF_ATOMIC_INIT(_private->read_value, 0); + GF_ATOMIC_INIT(_private->write_value, 0); _private->export_statfs = 1; tmp_data = dict_get(this->options, "export-statfs-size"); |