From: Greg Farnum Date: Fri, 5 May 2017 20:16:48 +0000 (-0700) Subject: mon: pgstat: expose the full osd_stat map to remove a get_pg_map() call X-Git-Tag: ses5-milestone6~8^2~19^2~110 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=02f7a189b8d4f3d52c0799762051cc288c288cf7;p=ceph.git mon: pgstat: expose the full osd_stat map to remove a get_pg_map() call Signed-off-by: Greg Farnum --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index db5c9f52d75..184df66331f 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -3686,7 +3686,7 @@ void OSDMonitor::get_health(list >& summary, } map full, backfillfull, nearfull; - osdmap.get_full_osd_util(mon->pgservice->get_pg_map().osd_stat, &full, &backfillfull, &nearfull); + osdmap.get_full_osd_util(*mon->pgservice->get_osd_stat(), &full, &backfillfull, &nearfull); if (full.size()) { ostringstream ss; ss << full.size() << " full osd(s)"; diff --git a/src/mon/PGStatService.h b/src/mon/PGStatService.h index 661bd063598..371526f4b50 100644 --- a/src/mon/PGStatService.h +++ b/src/mon/PGStatService.h @@ -45,6 +45,7 @@ public: virtual OSDStatIter osd_stat_iter_begin() const = 0; virtual OSDStatIter osd_stat_iter_end() const = 0; virtual const osd_stat_t *get_osd_stat(int osd) const = 0; + virtual const ceph::unordered_map *get_osd_stat() const = 0; virtual float get_full_ratio() const = 0; virtual float get_nearfull_ratio() const = 0; virtual bool have_creating_pgs() const = 0; @@ -122,6 +123,9 @@ public: } return &i->second; } + const ceph::unordered_map *get_osd_stat() const { + return &parent.osd_stat; + } float get_full_ratio() const { return parent.full_ratio; } float get_nearfull_ratio() const { return parent.nearfull_ratio; }