diff options
| author | Yaniv Kaul <ykaul@redhat.com> | 2018-12-14 19:18:20 +0200 | 
|---|---|---|
| committer | Ravishankar N <ravishankar@redhat.com> | 2018-12-18 06:54:53 +0000 | 
| commit | f9859218da827eac5b2102673e7a89497228e672 (patch) | |
| tree | 4a9eb2272f243b7d1ff8b9e2102c68cf36e9579f | |
| parent | f9220c89ae848c72df8232163d5a990283f15f5a (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
| -rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-common.c | 16 | 
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  | 
