]> Pileus Git - ~andy/linux/commitdiff
crush: add SET_CHOOSE_TRIES rule step
authorIlya Dryomov <ilya.dryomov@inktank.com>
Tue, 24 Dec 2013 19:19:26 +0000 (21:19 +0200)
committerIlya Dryomov <ilya.dryomov@inktank.com>
Tue, 31 Dec 2013 18:32:23 +0000 (20:32 +0200)
Since we can specify the recursive retries in a rule, we may as well also
specify the non-recursive tries too for completeness.

Reflects ceph.git commit d1b97462cffccc871914859eaee562f2786abfd1.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
include/linux/crush/crush.h
net/ceph/crush/mapper.c

index 07b8fd4f81fc238abb95014ed70410b3f6d8cd36..5f95969347ec52ba66016067651c7480ab50a0cc 100644 (file)
@@ -47,7 +47,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 c34320518c8bdaf6b4afa0fd9b6f0e5660c816aa..a1acdea935bf7fb3c8c200813826e90a544eb38d 100644 (file)
@@ -661,6 +661,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;