]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: give PGStatService a reweight_by_utilization indirection
authorGreg Farnum <gfarnum@redhat.com>
Fri, 5 May 2017 04:49:17 +0000 (21:49 -0700)
committerSage Weil <sage@redhat.com>
Fri, 2 Jun 2017 16:59:42 +0000 (12:59 -0400)
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/mon/OSDMonitor.cc
src/mon/PGStatService.h

index 1a2c1907125b937007f82ce175dfcda311626167..db5c9f52d75e2225344ac03f451e309d7decfbc4 100644 (file)
@@ -9230,16 +9230,15 @@ done:
     cmd_getval(g_ceph_context, cmdmap, "no_increasing", no_increasing);
     string out_str;
     mempool::osdmap::map<int32_t, uint32_t> new_weights;
-    err = reweight::by_utilization(osdmap,
-                                  mon->pgservice->get_pg_map(),
-                                  oload,
-                                  max_change,
-                                  max_osds,
-                                  by_pg,
-                                  pools.empty() ? NULL : &pools,
-                                  no_increasing == "--no-increasing",
-                                  &new_weights,
-                                  &ss, &out_str, f.get());
+    err = mon->pgservice->reweight_by_utilization(osdmap,
+                                            oload,
+                                            max_change,
+                                            max_osds,
+                                            by_pg,
+                                            pools.empty() ? NULL : &pools,
+                                            no_increasing == "--no-increasing",
+                                            &new_weights,
+                                            &ss, &out_str, f.get());
     if (err >= 0) {
       dout(10) << "reweight::by_utilization: finished with " << out_str << dendl;
     }
index b6a64457e51c4bbe9af3c0c31f8aa7979a3f6c3a..99cd7c183f76bc58962418efb13a5dddd2c2ee39 100644 (file)
@@ -105,6 +105,22 @@ public:
                         bufferlist *odata) {
     return process_pg_map_command(prefix, cmdmap, parent, osdmap, f, ss, odata);
   }
+
+  int reweight_by_utilization(const OSDMap &osd_map,
+                             int oload,
+                             double max_changef,
+                             int max_osds,
+                             bool by_pg, const set<int64_t> *pools,
+                             bool no_increasing,
+                             mempool::osdmap::map<int32_t, uint32_t>* new_weights,
+                             std::stringstream *ss,
+                             std::string *out_str,
+                             Formatter *f) {
+    return reweight::by_utilization(osd_map, parent, oload, max_changef,
+                                   max_osds, by_pg, pools, no_increasing,
+                                   new_weights, ss, out_str, f);
+  }
+
 };