Skip to content

Commit 8f99c85

Browse files
committed
crush: reduce scope of some local variables
Reflects ceph.git commit e7d47827f0333c96ad43d257607fb92ed4176550. Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
1 parent bfb16d7 commit 8f99c85

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎net/ceph/crush/mapper.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,15 @@ static int terminal(int x)
189189
static int bucket_tree_choose(struct crush_bucket_tree *bucket,
190190
int x, int r)
191191
{
192-
int n, l;
192+
int n;
193193
__u32 w;
194194
__u64 t;
195195

196196
/* start at root */
197197
n = bucket->num_nodes >> 1;
198198

199199
while (!terminal(n)) {
200+
int l;
200201
/* pick point in [0, w) */
201202
w = bucket->node_weights[n];
202203
t = (__u64)crush_hash32_4(bucket->h.hash, x, n, r,
@@ -496,7 +497,6 @@ int crush_do_rule(const struct crush_map *map,
496497
__u32 step;
497498
int i, j;
498499
int numrep;
499-
int firstn;
500500
const int descend_once = 0;
501501

502502
if ((__u32)ruleno >= map->max_rules) {
@@ -510,9 +510,9 @@ int crush_do_rule(const struct crush_map *map,
510510
o = b;
511511

512512
for (step = 0; step < rule->len; step++) {
513+
int firstn = 0;
513514
struct crush_rule_step *curstep = &rule->steps[step];
514515

515-
firstn = 0;
516516
switch (curstep->op) {
517517
case CRUSH_RULE_TAKE:
518518
w[0] = curstep->arg1;

0 commit comments

Comments
 (0)