summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix-helpers.c
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2017-02-28 14:27:51 +0530
committerjiffin tony Thottan <jthottan@redhat.com>2017-04-04 05:01:15 -0400
commit5e1324fffebbf6a650d6aff33849a8362300c1cc (patch)
treeae681e0acac35b58bd4a9f202d2d154b6e96d405 /xlators/storage/posix/src/posix-helpers.c
parent7920d7f3879ca5971d4e7ba569534934bfa676e8 (diff)
storage/posix: Use more granular mutex locks for atomic writes
Backport of: https://review.gluster.org/16785 Change-Id: I64aa561cb76ff9d4597d91fb5aeb64531698936a BUG: 1427390 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: https://review.gluster.org/16892 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/storage/posix/src/posix-helpers.c')
-rw-r--r--xlators/storage/posix/src/posix-helpers.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
index 190298db235..0ed8015294b 100644
--- a/xlators/storage/posix/src/posix-helpers.c
+++ b/xlators/storage/posix/src/posix-helpers.c
@@ -2195,10 +2195,12 @@ __posix_inode_ctx_get (inode_t *inode, xlator_t *this)
return NULL;
pthread_mutex_init (&ctx_p->xattrop_lock, NULL);
+ pthread_mutex_init (&ctx_p->write_atomic_lock, NULL);
ret = __inode_ctx_set (inode, this, (uint64_t *)&ctx_p);
if (ret < 0) {
pthread_mutex_destroy (&ctx_p->xattrop_lock);
+ pthread_mutex_destroy (&ctx_p->write_atomic_lock);
GF_FREE (ctx_p);
return NULL;
}