]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush/mapper: add SET_CHOOSE_TRIES rule step
authorSage Weil <sage@inktank.com>
Tue, 3 Dec 2013 16:34:39 +0000 (08:34 -0800)
committerSage Weil <sage@inktank.com>
Fri, 6 Dec 2013 22:24:02 +0000 (14:24 -0800)
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 <sage@inktank.com>
src/crush/crush.h
src/crush/mapper.c

index 2f3812ca68bb30d40ba6e84f1f50506407259b86..54e8f5f7e5708968ff0faaad325a0b0f62d28882 100644 (file)
@@ -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 */
 };
 
 /*
index 9110cc52df10b0a86595e49165a03b0307cd6a20..38faa690e08ea4f7fc2e58b2e9c3707984b33114 100644 (file)
@@ -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;