]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
src/crush/mapper.c: reduce scope of some local variables
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 16 May 2013 12:15:13 +0000 (14:15 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 16 May 2013 12:15:13 +0000 (14:15 +0200)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/crush/mapper.c

index c4f244524a5ff35410d83d4f47768c33acbd285f..3215564172a5dbed8c1ecbfac47bb087073efb23 100644 (file)
@@ -188,7 +188,7 @@ static int terminal(int x)
 static int bucket_tree_choose(struct crush_bucket_tree *bucket,
                              int x, int r)
 {
-       int n, l;
+       int n;
        __u32 w;
        __u64 t;
 
@@ -196,6 +196,7 @@ static int bucket_tree_choose(struct crush_bucket_tree *bucket,
        n = bucket->num_nodes >> 1;
 
        while (!terminal(n)) {
+               int l;
                /* pick point in [0, w) */
                w = bucket->node_weights[n];
                t = (__u64)crush_hash32_4(bucket->h.hash, x, n, r,
@@ -493,7 +494,6 @@ int crush_do_rule(const struct crush_map *map,
        __u32 step;
        int i, j;
        int numrep;
-       int firstn;
        const int descend_once = 0;
 
        if ((__u32)ruleno >= map->max_rules) {
@@ -507,9 +507,9 @@ int crush_do_rule(const struct crush_map *map,
        o = b;
 
        for (step = 0; step < rule->len; step++) {
+               int firstn = 0;
                struct crush_rule_step *curstep = &rule->steps[step];
 
-               firstn = 0;
                switch (curstep->op) {
                case CRUSH_RULE_TAKE:
                        w[0] = curstep->arg1;