diff options
author | Ilya Dryomov <ilya.dryomov@inktank.com> | 2013-12-24 14:19:26 -0500 |
---|---|---|
committer | Ilya Dryomov <ilya.dryomov@inktank.com> | 2013-12-31 13:32:23 -0500 |
commit | cc10df4a3a5c34cb1d5b635ac70dd1fc406153ce (patch) | |
tree | 76d7ee1a25c12f0abf4d31cdd55025bc521ab242 | |
parent | f18650ace38ef200dd1578257c75e9407297953c (diff) |
crush: 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.
Reflects ceph.git commit d1b97462cffccc871914859eaee562f2786abfd1.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | include/linux/crush/crush.h | 3 | ||||
-rw-r--r-- | net/ceph/crush/mapper.c | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/crush/crush.h b/include/linux/crush/crush.h index 07b8fd4f81fc..5f95969347ec 100644 --- a/include/linux/crush/crush.h +++ b/include/linux/crush/crush.h | |||
@@ -47,7 +47,8 @@ enum { | |||
47 | CRUSH_RULE_CHOOSE_LEAF_FIRSTN = 6, | 47 | CRUSH_RULE_CHOOSE_LEAF_FIRSTN = 6, |
48 | CRUSH_RULE_CHOOSE_LEAF_INDEP = 7, | 48 | CRUSH_RULE_CHOOSE_LEAF_INDEP = 7, |
49 | 49 | ||
50 | CRUSH_RULE_SET_CHOOSE_LEAF_TRIES = 9, | 50 | CRUSH_RULE_SET_CHOOSE_TRIES = 8, /* override choose_total_tries */ |
51 | CRUSH_RULE_SET_CHOOSE_LEAF_TRIES = 9, /* override chooseleaf_descend_once */ | ||
51 | }; | 52 | }; |
52 | 53 | ||
53 | /* | 54 | /* |
diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c index c34320518c8b..a1acdea935bf 100644 --- a/net/ceph/crush/mapper.c +++ b/net/ceph/crush/mapper.c | |||
@@ -661,6 +661,11 @@ int crush_do_rule(const struct crush_map *map, | |||
661 | wsize = 1; | 661 | wsize = 1; |
662 | break; | 662 | break; |
663 | 663 | ||
664 | case CRUSH_RULE_SET_CHOOSE_TRIES: | ||
665 | if (curstep->arg1 > 0) | ||
666 | choose_tries = curstep->arg1; | ||
667 | break; | ||
668 | |||
664 | case CRUSH_RULE_SET_CHOOSE_LEAF_TRIES: | 669 | case CRUSH_RULE_SET_CHOOSE_LEAF_TRIES: |
665 | if (curstep->arg1 > 0) | 670 | if (curstep->arg1 > 0) |
666 | choose_leaf_tries = curstep->arg1; | 671 | choose_leaf_tries = curstep->arg1; |