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 <[email protected]>
---
 include/linux/crush/crush.h |    3 ++-
 net/ceph/crush/mapper.c     |    5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)

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 {
        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/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,
                        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;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to