]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush/builder.c: reduce scope of oldsize in crush_add_rule()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 27 Feb 2013 17:53:28 +0000 (18:53 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 27 Feb 2013 17:53:28 +0000 (18:53 +0100)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/crush/builder.c

index 880c80902438bfda4e489364d36202e66b50b52f..5b5f58a470805cc8adcba4eda63fc710dda70ee1 100644 (file)
@@ -55,7 +55,6 @@ void crush_finalize(struct crush_map *map)
 int crush_add_rule(struct crush_map *map, struct crush_rule *rule, int ruleno)
 {
        __u32 r;
-       int oldsize;
 
        if (ruleno < 0) {
                for (r=0; r < map->max_rules; r++)
@@ -68,6 +67,7 @@ int crush_add_rule(struct crush_map *map, struct crush_rule *rule, int ruleno)
 
        if (r >= map->max_rules) {
                /* expand array */
+               int oldsize;
                oldsize = map->max_rules;
                map->max_rules = r+1;
                map->rules = realloc(map->rules, map->max_rules * sizeof(map->rules[0]));