From d6731f9499e4705674c63d52a6ba6360e849a3f5 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 24 Feb 2008 15:07:49 -0800 Subject: [PATCH] crush: git bucket id calc for additional buckets --- src/crush/builder.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/crush/builder.c b/src/crush/builder.c index 6a45ce2a6ef68..8f82d4b609191 100644 --- a/src/crush/builder.c +++ b/src/crush/builder.c @@ -98,11 +98,11 @@ void crush_rule_set_step(struct crush_rule *rule, int n, int op, int arg1, int a /** buckets **/ int crush_get_next_bucket_id(struct crush_map *map) { - int id; - for (id=0; id < map->max_buckets; id++) - if (map->buckets[id] == 0) - return id; - return -1 - id; + int pos; + for (pos=0; pos < map->max_buckets; pos++) + if (map->buckets[pos] == 0) + break; + return -1 - pos; } -- 2.39.5