summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2018-12-14 19:18:20 +0200
committerRavishankar N <ravishankar@redhat.com>2018-12-18 06:54:53 +0000
commitf9859218da827eac5b2102673e7a89497228e672 (patch)
tree4a9eb2272f243b7d1ff8b9e2102c68cf36e9579f /xlators/cluster/afr
parentf9220c89ae848c72df8232163d5a990283f15f5a (diff)
xlators/cluster/afr/src/afr-self-heal-common.c: remove a variable array.
Added '-Wvla' and saw this - gcc doesn't like variable arrays. There are plenty of others in the EC code, but this seems OK to remove: there is no use for the array members (I hope - that was from reading the code). Compile-tested only! updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I350f4520e52b86c8bbcd60eea1b27ef99cd119aa
Diffstat (limited to 'xlators/cluster/afr')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index 071ed1ccd32..3caa6897424 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -167,27 +167,23 @@ afr_selfheal_gfid_mismatch_by_majority(struct afr_reply *replies,
{
int j = 0;
int i = 0;
- int src = -1;
- int votes[child_count];
+ int votes;
for (i = 0; i < child_count; i++) {
if (!replies[i].valid || replies[i].op_ret == -1)
continue;
- votes[i] = 1;
+ votes = 1;
for (j = i + 1; j < child_count; j++) {
if ((!gf_uuid_compare(replies[i].poststat.ia_gfid,
replies[j].poststat.ia_gfid)))
- votes[i]++;
- if (votes[i] > child_count / 2) {
- src = i;
- goto out;
- }
+ votes++;
+ if (votes > child_count / 2)
+ return i;
}
}
-out:
- return src;
+ return -1;
}
int