Assuming firstn is for replica and indep is for erasure. This is a
strong constraint but it is unlikely to make the resulting ruleset unfit
to be used in most cases.
Signed-off-by: Loic Dachary <loic@dachary.org>
int steps = 3;
if (mode == "indep")
steps = 4;
- crush_rule *rule = crush_make_rule(steps, ruleset, rule_type, 1, 10);
+ int min_rep = mode == "firstn" ? 1 : 3;
+ int max_rep = mode == "firstn" ? 10 : 20;
+ crush_rule *rule = crush_make_rule(steps, ruleset, rule_type, min_rep, max_rep);
assert(rule);
int step = 0;
if (mode == "indep")