Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309439
b: refs/heads/master
c: 0668216
h: refs/heads/master
i:
  309437: 37aaca1
  309435: 3a953b7
  309431: 1fca022
  309423: 937db44
  309407: 8aed976
  309375: e94504f
v: v3
  • Loading branch information
Sage Weil committed May 7, 2012
1 parent 24ac6a6 commit 2acd2f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a1f4895be8bf1ba56c2306b058f51619e9b0e8f8
refs/heads/master: 0668216efe16ab1adf077e5f138775cee2af927a
20 changes: 11 additions & 9 deletions trunk/net/ceph/crush/mapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,14 +519,15 @@ int crush_do_rule(const 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;

/* find position in force_context/hierarchy */
while (force_pos >= 0 &&
force_context[force_pos] != w[0])
while (force_pos >= 0 && force_context[force_pos] != w[0])
force_pos--;
/* and move past it */
if (force_pos >= 0)
Expand All @@ -538,15 +539,16 @@ int crush_do_rule(const struct crush_map *map,
case CRUSH_RULE_CHOOSE_LEAF_FIRSTN:
case CRUSH_RULE_CHOOSE_FIRSTN:
firstn = 1;
/* fall through */
case CRUSH_RULE_CHOOSE_LEAF_INDEP:
case CRUSH_RULE_CHOOSE_INDEP:
if (wsize == 0)
break;

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 */
Expand All @@ -558,7 +560,7 @@ int crush_do_rule(const 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)
Expand All @@ -569,7 +571,7 @@ int crush_do_rule(const 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--;
Expand All @@ -583,7 +585,7 @@ int crush_do_rule(const 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);
Expand Down

0 comments on commit 2acd2f5

Please sign in to comment.