From: Sage Weil Date: Tue, 3 Dec 2013 16:34:39 +0000 (-0800) Subject: crush/mapper: add SET_CHOOSE_TRIES rule step X-Git-Tag: v0.74~16^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d1b97462cffccc871914859eaee562f2786abfd1;p=ceph.git crush/mapper: add SET_CHOOSE_TRIES rule step Since we can specify the recursive retries in a rule, we may as well also specify the non-recursive tries too for completeness. Signed-off-by: Sage Weil --- diff --git a/src/crush/crush.h b/src/crush/crush.h index 2f3812ca68b..54e8f5f7e57 100644 --- a/src/crush/crush.h +++ b/src/crush/crush.h @@ -56,7 +56,8 @@ enum { CRUSH_RULE_CHOOSE_LEAF_FIRSTN = 6, CRUSH_RULE_CHOOSE_LEAF_INDEP = 7, - CRUSH_RULE_SET_CHOOSE_LEAF_TRIES = 9, + CRUSH_RULE_SET_CHOOSE_TRIES = 8, /* override choose_total_tries */ + CRUSH_RULE_SET_CHOOSE_LEAF_TRIES = 9, /* override chooseleaf_descend_once */ }; /* diff --git a/src/crush/mapper.c b/src/crush/mapper.c index 9110cc52df1..38faa690e08 100644 --- a/src/crush/mapper.c +++ b/src/crush/mapper.c @@ -655,6 +655,11 @@ int crush_do_rule(const struct crush_map *map, wsize = 1; break; + case CRUSH_RULE_SET_CHOOSE_TRIES: + if (curstep->arg1 > 0) + choose_tries = curstep->arg1; + break; + case CRUSH_RULE_SET_CHOOSE_LEAF_TRIES: if (curstep->arg1 > 0) choose_leaf_tries = curstep->arg1;