crush: add SET_CHOOSELEAF_VARY_R step
authorIlya Dryomov <ilya.dryomov@inktank.com>
Wed, 19 Mar 2014 14:58:37 +0000 (16:58 +0200)
committerSage Weil <sage@inktank.com>
Sat, 5 Apr 2014 04:07:28 +0000 (21:07 -0700)
This lets you adjust the vary_r tunable on a per-rule basis.

Reflects ceph.git commit f944ccc20aee60a7d8da7e405ec75ad1cd449fac.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
include/linux/crush/crush.h
net/ceph/crush/mapper.c

index 75f36a6c7f67c6632fad8c728e6002c32aaf000c..4fad5f8ee01d3457974551ef1f874fc61f0524f9 100644 (file)
@@ -51,6 +51,7 @@ enum {
        CRUSH_RULE_SET_CHOOSELEAF_TRIES = 9, /* override chooseleaf_descend_once */
        CRUSH_RULE_SET_CHOOSE_LOCAL_TRIES = 10,
        CRUSH_RULE_SET_CHOOSE_LOCAL_FALLBACK_TRIES = 11,
+       CRUSH_RULE_SET_CHOOSELEAF_VARY_R = 12
 };
 
 /*
index 947150cde297afea3b1e58a0b72b2caff09f3433..a1ef53c044151be9df2ac4e61e0631226d59f0a8 100644 (file)
@@ -709,6 +709,11 @@ int crush_do_rule(const struct crush_map *map,
                                choose_local_fallback_retries = curstep->arg1;
                        break;
 
+               case CRUSH_RULE_SET_CHOOSELEAF_VARY_R:
+                       if (curstep->arg1 >= 0)
+                               vary_r = curstep->arg1;
+                       break;
+
                case CRUSH_RULE_CHOOSELEAF_FIRSTN:
                case CRUSH_RULE_CHOOSE_FIRSTN:
                        firstn = 1;