diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2019-06-08 01:22:27 +0300 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2019-08-01 04:12:07 +0000 |
commit | d68e426263708334945dff69b88218ed71a48033 (patch) | |
tree | c9739c005f4531493593e07c60594b4ad6944794 /xlators/cluster | |
parent | d7e449b0da35a30af876aef1bea1fb096d0c06dc (diff) |
Multiple files: get trivial stuff done before lock
Initialize a dictionary for example seems to be prefectly fine to be done
before taking a lock.
Change-Id: Ib29516c4efa8f0e2b526d512beab488fcd16d2e7
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 10 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-rebalance.c | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index bce0af5791a..a1d9148915b 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -5052,20 +5052,18 @@ __afr_launch_notify_timer(xlator_t *this, afr_private_t *priv) } } -int +static int __get_heard_from_all_status(xlator_t *this) { afr_private_t *priv = this->private; - int heard_from_all = 1; - int i = 0; + int i; for (i = 0; i < priv->child_count; i++) { if (!priv->last_event[i]) { - heard_from_all = 0; - break; + return 0; } } - return heard_from_all; + return 1; } static int diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c index ea63c3c5e74..ab4b7715b66 100644 --- a/xlators/cluster/dht/src/dht-rebalance.c +++ b/xlators/cluster/dht/src/dht-rebalance.c @@ -4787,9 +4787,9 @@ out: dht_send_rebalance_event(this, defrag->cmd, defrag->defrag_status); + status = dict_new(); LOCK(&defrag->lock); { - status = dict_new(); gf_defrag_status_get(conf, status); if (ctx && ctx->notify) ctx->notify(GF_EN_DEFRAG_STATUS, status); |