summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorshishir gowda <sgowda@redhat.com>2013-11-15 14:53:44 +0530
committershishir gowda <sgowda@redhat.com>2013-11-15 14:53:44 +0530
commitf0503527548a13cd1af2db640488b4c01857fc4d (patch)
treef8dcccb2d0d824ba1b81c5bb4b293359a10b6d56 /xlators
parent6acf65e64cb6cd50b05ef8e60769ab3d5dc32ef7 (diff)
snapshot: Merge conflict resolution
Signed-off-by: shishir gowda <sgowda@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c11
-rw-r--r--xlators/protocol/server/src/server-helpers.c31
2 files changed, 24 insertions, 18 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index 7a0b7fc..7ad63bd 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -694,6 +694,11 @@ glusterd_volume_exclude_options_write (int fd, glusterd_volinfo_t *volinfo)
if (ret)
goto out;
}
+ snprintf (buf, sizeof (buf), "%"PRIu64, volinfo->snap_max_limit);
+ ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_SNAP_MAX_LIMIT,
+ buf);
+ if (ret)
+ goto out;
out:
if (ret)
@@ -1698,11 +1703,7 @@ glusterd_store_volinfo_atomic_update (glusterd_volinfo_t *volinfo)
ret = gf_store_rename_tmppath (volinfo->shandle);
if (ret)
goto out;
- snprintf (buf, sizeof (buf), "%"PRIu64, volinfo->snap_max_limit);
- ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_SNAP_MAX_LIMIT,
- buf);
- if (ret)
- goto out;
+
out:
if (ret)
gf_log (THIS->name, GF_LOG_ERROR, "Couldn't rename "
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index 03e3ec3..ff23959 100644
--- a/xlators/protocol/server/src/server-helpers.c
+++ b/xlators/protocol/server/src/server-helpers.c
@@ -1004,14 +1004,12 @@ gf_barrier_dequeue (gf_barrier_t *barrier)
if (!barrier || list_empty (&barrier->queue))
return NULL;
- LOCK (&barrier->lock);
- {
- payload = list_entry (barrier->queue.next,
- gf_barrier_payload_t, list);
+ payload = list_entry (barrier->queue.next,
+ gf_barrier_payload_t, list);
+ if (payload) {
list_del_init (&payload->list);
barrier->cur_size--;
}
- UNLOCK (&barrier->lock);
return payload;
}
@@ -1029,17 +1027,20 @@ gf_barrier_dequeue_start (void *data)
return;
barrier = conf->barrier;
-
- while (!list_empty (&barrier->queue)) {
- payload = gf_barrier_dequeue (barrier);
- if (payload) {
- if (gf_barrier_transmit (conf, payload)) {
- gf_log ("server", GF_LOG_WARNING,
- "Failed to transmit");
+ LOCK (&barrier->lock);
+ {
+ while (barrier->cur_size) {
+ payload = gf_barrier_dequeue (barrier);
+ if (payload) {
+ if (gf_barrier_transmit (conf, payload)) {
+ gf_log ("server", GF_LOG_WARNING,
+ "Failed to transmit");
+ }
+ GF_FREE (payload);
}
- GF_FREE (payload);
}
}
+ UNLOCK (&barrier->lock);
return;
}
@@ -1055,6 +1056,7 @@ gf_barrier_timeout (void *data)
goto out;
barrier = conf->barrier;
+ gf_log ("", GF_LOG_INFO, "barrier timed-out");
LOCK (&barrier->lock);
{
need_dequeue = barrier->on;
@@ -1085,6 +1087,7 @@ gf_barrier_start (xlator_t *this)
barrier = conf->barrier;
+ gf_log (this->name, GF_LOG_INFO, "barrier start called");
LOCK (&barrier->lock);
{
/* if barrier is on, reset timer */
@@ -1134,6 +1137,7 @@ gf_barrier_stop (xlator_t *this)
barrier = conf->barrier;
+ gf_log (this->name, GF_LOG_INFO, "barrier stop called");
LOCK (&barrier->lock);
{
need_dequeue = barrier->on;
@@ -1205,6 +1209,7 @@ done:
{
barrier->fops = fops;
}
+ UNLOCK (&barrier->lock);
ret = 0;
GF_FREE (dup_str);