summaryrefslogtreecommitdiffstats
path: root/xlators/lib/src/libxlator.c
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2018-12-27 18:56:16 +0200
committerAmar Tumballi <amarts@redhat.com>2019-01-29 09:27:22 +0000
commitc7d1aee76d5713d1f337ab1c831c0ed74e4676e1 (patch)
treedac0618f33a560ae1bfbd5c92c5762d42d26797b /xlators/lib/src/libxlator.c
parentf747d55a7fd364e2b9a74fe40360ab3cb7b11537 (diff)
Multiple files: reduce work while under lock.
Mostly, unlock before logging. In some cases, moved different code that was not needed to be under lock (for example, taking time, or malloc'ing) to be executed before taking the lock. Note: logging might be slightly less accurate in order, since it may not be done now under the lock, so order of logs is racy. I think it's a reasonable compromise. Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I2438710016afc9f4f62a176ef1a0d3ed793b4f89
Diffstat (limited to 'xlators/lib/src/libxlator.c')
-rw-r--r--xlators/lib/src/libxlator.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/xlators/lib/src/libxlator.c b/xlators/lib/src/libxlator.c
index e1a22b60340..075229dae76 100644
--- a/xlators/lib/src/libxlator.c
+++ b/xlators/lib/src/libxlator.c
@@ -198,10 +198,11 @@ cluster_markerxtime_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
}
if (dict_get_ptr(dict, marker_xattr, (void **)&net_timebuf)) {
+ local->count[MCNT_NOTFOUND]++;
+ UNLOCK(&frame->lock);
gf_log(this->name, GF_LOG_WARNING,
"Unable to get <uuid>.xtime attr");
- local->count[MCNT_NOTFOUND]++;
- goto unlock;
+ goto post_unlock;
}
if (local->count[MCNT_FOUND]) {
@@ -221,7 +222,7 @@ cluster_markerxtime_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
}
unlock:
UNLOCK(&frame->lock);
-
+post_unlock:
if (callcnt == 0)
cluster_marker_unwind(frame, marker_xattr, local->net_timebuf, 8, dict);