]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: add SET_CHOOSELEAF_VARY_R step
authorSage Weil <sage@inktank.com>
Tue, 4 Feb 2014 21:40:49 +0000 (13:40 -0800)
committerSage Weil <sage@inktank.com>
Tue, 11 Feb 2014 16:48:14 +0000 (08:48 -0800)
This lets you adjust the vary_r tunable on a per-rule basis.

Signed-off-by: Sage Weil <sage@inktank.com>
src/crush/crush.h
src/crush/mapper.c

index 249a99291070a86f357d4303a3ea755818f13b5f..8bac92aaa9ed53fc0022c84fd92e48dc53f5112a 100644 (file)
@@ -59,6 +59,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 89227028f7281514cb02b3ed11fff14eaa8ecb67..22cde518f58a4948967f0a582f962328276de9e6 100644 (file)
@@ -741,6 +741,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;