summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage.weil@dreamhost.com>2011-09-03 16:15:08 -0700
committerSage Weil <sage.weil@dreamhost.com>2011-09-06 21:03:05 -0700
commitdebff107b60dff420c166c967ff74fc6d4a58f2b (patch)
tree340a4ce2cbbd32c6a8d456f1d5696a1db9151d14
parent2d2746f1eab09236fa5fcde446546f57ba537c3c (diff)
downloadceph-debff107b60dff420c166c967ff74fc6d4a58f2b.tar.gz
crush: cleanup using temp var
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
-rw-r--r--src/crush/mapper.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/crush/mapper.c b/src/crush/mapper.c
index cb8195aa575..609256b6c47 100644
--- a/src/crush/mapper.c
+++ b/src/crush/mapper.c
@@ -512,10 +512,12 @@ int crush_do_rule(struct crush_map *map,
}
for (step = 0; step < rule->len; step++) {
+ struct crush_rule_step *curstep = &rule->steps[step];
+
firstn = 0;
- switch (rule->steps[step].op) {
+ switch (curstep->op) {
case CRUSH_RULE_TAKE:
- w[0] = rule->steps[step].arg1;
+ w[0] = curstep->arg1;
if (force_pos >= 0) {
if (force_context[force_pos] != w[0]) {
rc = -1; /* forced mapping dne */
@@ -535,9 +537,9 @@ int crush_do_rule(struct crush_map *map,
BUG_ON(wsize == 0);
recurse_to_leaf =
- rule->steps[step].op ==
+ curstep->op ==
CRUSH_RULE_CHOOSE_LEAF_FIRSTN ||
- rule->steps[step].op ==
+ curstep->op ==
CRUSH_RULE_CHOOSE_LEAF_INDEP;
/* reset output */
@@ -549,7 +551,7 @@ int crush_do_rule(struct crush_map *map,
* basically, numrep <= 0 means relative to
* the provided result_max
*/
- numrep = rule->steps[step].arg1;
+ numrep = curstep->arg1;
if (numrep <= 0) {
numrep += result_max;
if (numrep <= 0)
@@ -560,7 +562,7 @@ int crush_do_rule(struct crush_map *map,
/* skip any intermediate types */
while (force_pos &&
force_context[force_pos] < 0 &&
- rule->steps[step].arg2 !=
+ curstep->arg2 !=
map->buckets[-1 -
force_context[force_pos]]->type)
force_pos--;
@@ -574,7 +576,7 @@ int crush_do_rule(struct crush_map *map,
map->buckets[-1-w[i]],
weight,
x, numrep,
- rule->steps[step].arg2,
+ curstep->arg2,
o+osize, j,
firstn,
recurse_to_leaf, c+osize);