From: Loic Dachary Date: Thu, 26 Dec 2013 18:50:37 +0000 (+0100) Subject: crush: add rule_type argument to add_simple_ruleset X-Git-Tag: v0.75~31^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=da67f7c3175b704dbc5877a0a145ce2b1fd87f0b;p=ceph.git crush: add rule_type argument to add_simple_ruleset Instead of hardcoded pg_pool_t::TYPE_REPLICATED Signed-off-by: Loic Dachary --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 3245793c62b0..56674eb0336b 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -708,6 +708,7 @@ void CrushWrapper::reweight(CephContext *cct) int CrushWrapper::add_simple_ruleset(string name, string root_name, string failure_domain_name, string mode, + int rule_type, ostream *err) { if (rule_exists(name)) { @@ -747,7 +748,7 @@ int CrushWrapper::add_simple_ruleset(string name, string root_name, int steps = 3; if (mode == "indep") steps = 4; - crush_rule *rule = crush_make_rule(steps, ruleset, 1 /* pg_pool_t::TYPE_REPLICATED */, 1, 10); + crush_rule *rule = crush_make_rule(steps, ruleset, rule_type, 1, 10); assert(rule); int step = 0; if (mode == "indep") diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h index 3b56bb4fc3e7..82ecc5568e35 100644 --- a/src/crush/CrushWrapper.h +++ b/src/crush/CrushWrapper.h @@ -647,7 +647,7 @@ public: } int add_simple_ruleset(string name, string root_name, string failure_domain_type, - string mode, ostream *err = 0); + string mode, int rule_type, ostream *err = 0); int remove_rule(int ruleno); diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index aa9001831d2b..e1dda867ac1e 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -3509,7 +3509,8 @@ bool OSDMonitor::prepare_command(MMonCommand *m) ss << "rule " << name << " already exists"; err = 0; } else { - int rule = newcrush.add_simple_ruleset(name, root, type, mode, &ss); + int rule = newcrush.add_simple_ruleset(name, root, type, mode, + pg_pool_t::TYPE_REPLICATED, &ss); if (rule < 0) { err = rule; goto reply;