diff options
author | Sage Weil <sage@inktank.com> | 2012-05-07 18:39:29 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-05-07 18:39:29 -0400 |
commit | 41ebcc0907c58f75d0b25afcaf8b9c35c6b1ad14 (patch) | |
tree | c05054ce3d7fc0e512501a708511a9b1bd8647eb /net | |
parent | 0668216efe16ab1adf077e5f138775cee2af927a (diff) |
crush: remove forcefeed functionality
Remove forcefeed functionality from CRUSH. This is an ugly misfeature that
is mostly useless and unused. Remove it.
Reflects ceph.git commit ed974b5000f2851207d860a651809af4a1867942.
Reviewed-by: Alex Elder <elder@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
Conflicts:
net/ceph/crush/mapper.c
Diffstat (limited to 'net')
-rw-r--r-- | net/ceph/crush/mapper.c | 48 | ||||
-rw-r--r-- | net/ceph/osdmap.c | 2 |
2 files changed, 2 insertions, 48 deletions
diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c index fba9460fe572..11cf352201ba 100644 --- a/net/ceph/crush/mapper.c +++ b/net/ceph/crush/mapper.c | |||
@@ -463,15 +463,12 @@ reject: | |||
463 | * @x: hash input | 463 | * @x: hash input |
464 | * @result: pointer to result vector | 464 | * @result: pointer to result vector |
465 | * @result_max: maximum result size | 465 | * @result_max: maximum result size |
466 | * @force: force initial replica choice; -1 for none | ||
467 | */ | 466 | */ |
468 | int crush_do_rule(const struct crush_map *map, | 467 | int crush_do_rule(const struct crush_map *map, |
469 | int ruleno, int x, int *result, int result_max, | 468 | int ruleno, int x, int *result, int result_max, |
470 | int force, const __u32 *weight) | 469 | const __u32 *weight) |
471 | { | 470 | { |
472 | int result_len; | 471 | int result_len; |
473 | int force_context[CRUSH_MAX_DEPTH]; | ||
474 | int force_pos = -1; | ||
475 | int a[CRUSH_MAX_SET]; | 472 | int a[CRUSH_MAX_SET]; |
476 | int b[CRUSH_MAX_SET]; | 473 | int b[CRUSH_MAX_SET]; |
477 | int c[CRUSH_MAX_SET]; | 474 | int c[CRUSH_MAX_SET]; |
@@ -497,27 +494,6 @@ int crush_do_rule(const struct crush_map *map, | |||
497 | w = a; | 494 | w = a; |
498 | o = b; | 495 | o = b; |
499 | 496 | ||
500 | /* | ||
501 | * determine hierarchical context of force, if any. note | ||
502 | * that this may or may not correspond to the specific types | ||
503 | * referenced by the crush rule. it will also only affect | ||
504 | * the first descent (TAKE). | ||
505 | */ | ||
506 | if (force >= 0 && | ||
507 | force < map->max_devices && | ||
508 | map->device_parents[force] != 0 && | ||
509 | !is_out(map, weight, force, x)) { | ||
510 | while (1) { | ||
511 | force_context[++force_pos] = force; | ||
512 | if (force >= 0) | ||
513 | force = map->device_parents[force]; | ||
514 | else | ||
515 | force = map->bucket_parents[-1-force]; | ||
516 | if (force == 0) | ||
517 | break; | ||
518 | } | ||
519 | } | ||
520 | |||
521 | for (step = 0; step < rule->len; step++) { | 497 | for (step = 0; step < rule->len; step++) { |
522 | struct crush_rule_step *curstep = &rule->steps[step]; | 498 | struct crush_rule_step *curstep = &rule->steps[step]; |
523 | 499 | ||
@@ -525,14 +501,6 @@ int crush_do_rule(const struct crush_map *map, | |||
525 | switch (curstep->op) { | 501 | switch (curstep->op) { |
526 | case CRUSH_RULE_TAKE: | 502 | case CRUSH_RULE_TAKE: |
527 | w[0] = curstep->arg1; | 503 | w[0] = curstep->arg1; |
528 | |||
529 | /* find position in force_context/hierarchy */ | ||
530 | while (force_pos >= 0 && force_context[force_pos] != w[0]) | ||
531 | force_pos--; | ||
532 | /* and move past it */ | ||
533 | if (force_pos >= 0) | ||
534 | force_pos--; | ||
535 | |||
536 | wsize = 1; | 504 | wsize = 1; |
537 | break; | 505 | break; |
538 | 506 | ||
@@ -567,20 +535,6 @@ int crush_do_rule(const struct crush_map *map, | |||
567 | continue; | 535 | continue; |
568 | } | 536 | } |
569 | j = 0; | 537 | j = 0; |
570 | if (osize == 0 && force_pos >= 0) { | ||
571 | /* skip any intermediate types */ | ||
572 | while (force_pos && | ||
573 | force_context[force_pos] < 0 && | ||
574 | curstep->arg2 != | ||
575 | map->buckets[-1 - | ||
576 | force_context[force_pos]]->type) | ||
577 | force_pos--; | ||
578 | o[osize] = force_context[force_pos]; | ||
579 | if (recurse_to_leaf) | ||
580 | c[osize] = force_context[0]; | ||
581 | j++; | ||
582 | force_pos--; | ||
583 | } | ||
584 | osize += crush_choose(map, | 538 | osize += crush_choose(map, |
585 | map->buckets[-1-w[i]], | 539 | map->buckets[-1-w[i]], |
586 | weight, | 540 | weight, |
diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c index 7d39f3cb4947..9dda36f7aa9d 100644 --- a/net/ceph/osdmap.c +++ b/net/ceph/osdmap.c | |||
@@ -1069,7 +1069,7 @@ static int *calc_pg_raw(struct ceph_osdmap *osdmap, struct ceph_pg pgid, | |||
1069 | pps += poolid; | 1069 | pps += poolid; |
1070 | *num = crush_do_rule(osdmap->crush, ruleno, pps, osds, | 1070 | *num = crush_do_rule(osdmap->crush, ruleno, pps, osds, |
1071 | min_t(int, pool->v.size, *num), | 1071 | min_t(int, pool->v.size, *num), |
1072 | -1, osdmap->osd_weight); | 1072 | osdmap->osd_weight); |
1073 | return osds; | 1073 | return osds; |
1074 | } | 1074 | } |
1075 | 1075 | ||