]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: pgstat: expose the full osd_stat map to remove a get_pg_map() call
authorGreg Farnum <gfarnum@redhat.com>
Fri, 5 May 2017 20:16:48 +0000 (13:16 -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 db5c9f52d75e2225344ac03f451e309d7decfbc4..184df66331f86cadd76f9c5b6a595578f0919a6e 100644 (file)
@@ -3686,7 +3686,7 @@ void OSDMonitor::get_health(list<pair<health_status_t,string> >& summary,
       }
 
       map<int, float> 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)";
index 661bd063598c3f0ce1d2a74112e4f1a8d9a41e56..371526f4b503ef844431797a68c24ae5524ea732 100644 (file)
@@ -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<int32_t,osd_stat_t> *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<int32_t,osd_stat_t> *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; }