]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: add rule_type argument to add_simple_ruleset
authorLoic Dachary <loic@dachary.org>
Thu, 26 Dec 2013 18:50:37 +0000 (19:50 +0100)
committerLoic Dachary <loic@dachary.org>
Thu, 26 Dec 2013 18:50:37 +0000 (19:50 +0100)
Instead of hardcoded pg_pool_t::TYPE_REPLICATED

Signed-off-by: Loic Dachary <loic@dachary.org>
src/crush/CrushWrapper.cc
src/crush/CrushWrapper.h
src/mon/OSDMonitor.cc

index 3245793c62b0719c54f979771c0817cd3589e2af..56674eb0336b3cc64856fd81ca6304b2893f2536 100644 (file)
@@ -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")
index 3b56bb4fc3e778202abff07ee1ee97d501ca765d..82ecc5568e3565e89c13a662581597b366092224 100644 (file)
@@ -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);
 
index aa9001831d2b4c1399a382ecb4b00e203f07a6fb..e1dda867ac1ecc63d2e4d1e63ce9f49c55a76546 100644 (file)
@@ -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;