summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix-aio.c
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawal@redhat.com>2018-12-10 11:14:04 +0530
committerXavi Hernandez <xhernandez@redhat.com>2019-01-15 11:52:22 +0000
commit2261e444a47ffffb5d64305efceee1d5a734cd75 (patch)
tree06f85f6e3f4ba6c81a62347ad6b4102f6ec2f847 /xlators/storage/posix/src/posix-aio.c
parentf578cdad23d8a8428a7012f777f4987507f19ea4 (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-aio.c')
-rw-r--r--xlators/storage/posix/src/posix-aio.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/xlators/storage/posix/src/posix-aio.c b/xlators/storage/posix/src/posix-aio.c
index 7ab38ed..971ace9 100644
--- a/xlators/storage/posix/src/posix-aio.c
+++ b/xlators/storage/posix/src/posix-aio.c
@@ -133,11 +133,7 @@ posix_aio_readv_complete(struct posix_aio_cb *paiocb, int res, int res2)
if (!postbuf.ia_size || (offset + iov.iov_len) >= postbuf.ia_size)
op_errno = ENOENT;
- LOCK(&priv->lock);
- {
- priv->read_value += op_ret;
- }
- UNLOCK(&priv->lock);
+ GF_ATOMIC_ADD(priv->read_value, op_ret);
out:
STACK_UNWIND_STRICT(readv, frame, op_ret, op_errno, &iov, 1, &postbuf,
@@ -301,11 +297,7 @@ posix_aio_writev_complete(struct posix_aio_cb *paiocb, int res, int res2)
op_ret = res;
op_errno = 0;
- LOCK(&priv->lock);
- {
- priv->write_value += op_ret;
- }
- UNLOCK(&priv->lock);
+ GF_ATOMIC_ADD(priv->write_value, op_ret);
out:
STACK_UNWIND_STRICT(writev, frame, op_ret, op_errno, &prebuf, &postbuf,