summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorMichael Scherer <misc@redhat.com>2017-02-22 17:27:43 +0100
committerShyamsundar Ranganathan <srangana@redhat.com>2017-02-26 11:30:50 -0500
commit66edcc856d89ffa33318443aa8680c9376772c4d (patch)
tree438f57faa78dbad033aeeb3bfe6be93ca920ecc8 /xlators/cluster
parent8bb29ed9d0d695c66b3be8a9aedb92d87b0c4054 (diff)
Reorder the variable initialisation
Found by coverity, since is_hot_tier is assigned to false, tier_type was always "hot" rather than "cold", making potential debugging likely harder. Change-Id: I49bce1c184548c5de5c00639e83fc3d2dbed90b2 BUG: 789278 Signed-off-by: Michael Scherer <misc@redhat.com> Reviewed-on: https://review.gluster.org/16717 Smoke: Gluster Build System <jenkins@build.gluster.org> Tested-by: Michael Scherer <misc@fedoraproject.org> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/dht/src/tier.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c
index b13c41cd2ab..a8aebe00f69 100644
--- a/xlators/cluster/dht/src/tier.c
+++ b/xlators/cluster/dht/src/tier.c
@@ -2308,7 +2308,7 @@ tier_prepare_compact (migration_args_t *args, gfdb_time_t current_time)
dht_conf_t *conf = NULL;
gf_defrag_info_t *defrag = NULL;
gf_tier_conf_t *tier_conf = NULL;
- gf_boolean_t is_hot_tier = _gf_false;
+ gf_boolean_t is_hot_tier = args->is_hot_tier;
int freq = 0;
int ret = -1;
const char *tier_type = is_hot_tier ? "hot" : "cold";
@@ -2321,8 +2321,6 @@ tier_prepare_compact (migration_args_t *args, gfdb_time_t current_time)
tier_conf = &defrag->tier_conf;
- is_hot_tier = args->is_hot_tier;
-
freq = is_hot_tier ? tier_get_freq_compact_hot (tier_conf) :
tier_get_freq_compact_cold (tier_conf);