diff options
Diffstat (limited to 'net/ceph/crush/mapper.c')
-rw-r--r-- | net/ceph/crush/mapper.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c index 125dbd04f2b6..c727836b5860 100644 --- a/net/ceph/crush/mapper.c +++ b/net/ceph/crush/mapper.c | |||
@@ -460,7 +460,8 @@ static void crush_choose_indep(const struct crush_map *map, | |||
460 | int x, int left, int numrep, int type, | 460 | int x, int left, int numrep, int type, |
461 | int *out, int outpos, | 461 | int *out, int outpos, |
462 | int recurse_to_leaf, | 462 | int recurse_to_leaf, |
463 | int *out2) | 463 | int *out2, |
464 | int parent_r) | ||
464 | { | 465 | { |
465 | struct crush_bucket *in = bucket; | 466 | struct crush_bucket *in = bucket; |
466 | int endpos = outpos + left; | 467 | int endpos = outpos + left; |
@@ -499,7 +500,7 @@ static void crush_choose_indep(const struct crush_map *map, | |||
499 | * this will involve more devices in data | 500 | * this will involve more devices in data |
500 | * movement and tend to distribute the load. | 501 | * movement and tend to distribute the load. |
501 | */ | 502 | */ |
502 | r = rep; | 503 | r = rep + parent_r; |
503 | 504 | ||
504 | /* be careful */ | 505 | /* be careful */ |
505 | if (in->alg == CRUSH_BUCKET_UNIFORM && | 506 | if (in->alg == CRUSH_BUCKET_UNIFORM && |
@@ -567,7 +568,7 @@ static void crush_choose_indep(const struct crush_map *map, | |||
567 | weight, weight_max, | 568 | weight, weight_max, |
568 | x, 1, numrep, 0, | 569 | x, 1, numrep, 0, |
569 | out2, rep, | 570 | out2, rep, |
570 | 0, NULL); | 571 | 0, NULL, r); |
571 | if (out2[rep] == CRUSH_ITEM_NONE) { | 572 | if (out2[rep] == CRUSH_ITEM_NONE) { |
572 | /* placed nothing; no leaf */ | 573 | /* placed nothing; no leaf */ |
573 | break; | 574 | break; |
@@ -702,7 +703,8 @@ int crush_do_rule(const struct crush_map *map, | |||
702 | curstep->arg2, | 703 | curstep->arg2, |
703 | o+osize, j, | 704 | o+osize, j, |
704 | recurse_to_leaf, | 705 | recurse_to_leaf, |
705 | c+osize); | 706 | c+osize, |
707 | 0); | ||
706 | osize += numrep; | 708 | osize += numrep; |
707 | } | 709 | } |
708 | } | 710 | } |