From: Greg Farnum Date: Fri, 5 May 2017 04:49:17 +0000 (-0700) Subject: mon: give PGStatService a reweight_by_utilization indirection X-Git-Tag: ses5-milestone6~8^2~19^2~112 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2148386d53a73f081da344f5064abb13d5e03908;p=ceph.git mon: give PGStatService a reweight_by_utilization indirection Signed-off-by: Greg Farnum --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 1a2c1907125b9..db5c9f52d75e2 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -9230,16 +9230,15 @@ done: cmd_getval(g_ceph_context, cmdmap, "no_increasing", no_increasing); string out_str; mempool::osdmap::map 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; } diff --git a/src/mon/PGStatService.h b/src/mon/PGStatService.h index b6a64457e51c4..99cd7c183f76b 100644 --- a/src/mon/PGStatService.h +++ b/src/mon/PGStatService.h @@ -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 *pools, + bool no_increasing, + mempool::osdmap::map* 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); + } + };