summaryrefslogtreecommitdiffstats
path: root/xlators/features/changelog/src/changelog-helpers.h
diff options
context:
space:
mode:
authorVijay Bellur <vbellur@redhat.com>2018-08-13 12:20:07 -0700
committerAmar Tumballi <amarts@redhat.com>2018-08-17 07:51:41 +0000
commit522352d4b123d66f7d0b57c287ed7367deba0f31 (patch)
treedbef2f8adec9515075cba93de38ceaa4e9cc708f /xlators/features/changelog/src/changelog-helpers.h
parent0058f6df0d2bd1dedc453585e6c4076df7b51fde (diff)
features/changelog: Fix missing unlocks
Addresses CID 1210981 Change-Id: Icd325588ae0639e09d924fdde171931dedd06ca6 updates: bz#789278 Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/changelog/src/changelog-helpers.h')
-rw-r--r--xlators/features/changelog/src/changelog-helpers.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/xlators/features/changelog/src/changelog-helpers.h b/xlators/features/changelog/src/changelog-helpers.h
index 39a792891dd..1551337c16f 100644
--- a/xlators/features/changelog/src/changelog-helpers.h
+++ b/xlators/features/changelog/src/changelog-helpers.h
@@ -675,6 +675,19 @@ resolve_pargfid_to_path (xlator_t *this, const uuid_t gfid, char **path,
goto label; \
} \
} while (0)
+
+/* Log pthread error, unlock mutex and goto label */
+#define CHANGELOG_PTHREAD_ERROR_HANDLE_2(ret, label, mutex) do { \
+ if (ret) { \
+ gf_smsg (this->name, GF_LOG_ERROR, \
+ 0, CHANGELOG_MSG_PTHREAD_ERROR, \
+ "pthread error", "error=%d", ret, NULL); \
+ ret = -1; \
+ pthread_mutex_unlock (&mutex); \
+ goto label; \
+ } \
+ } while (0)
+
/* End: Geo-Rep snapshot dependency changes */
#endif /* _CHANGELOG_HELPERS_H */