]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: more OSDMonitor de-pgmap-ification
authorGreg Farnum <gfarnum@redhat.com>
Tue, 14 Mar 2017 23:29:27 +0000 (16:29 -0700)
committerSage Weil <sage@redhat.com>
Fri, 2 Jun 2017 16:59:13 +0000 (12:59 -0400)
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/mon/OSDMonitor.cc
src/mon/PGStatService.h

index a24ad8d58a6bf8df90b70c42a31c35420032d350..e03c7e1bcd4aa89c4dd7be3897562473e0df4226 100644 (file)
@@ -851,7 +851,7 @@ public:
 
 void OSDMonitor::print_utilization(ostream &out, Formatter *f, bool tree) const
 {
-  const PGMap *pgm = &mon->pgmon()->pg_map;
+  const PGMap *pgm = &mon->pgservice.get_pg_map();
   const CrushWrapper *crush = osdmap.crush.get();
 
   if (f) {
@@ -1087,12 +1087,12 @@ void OSDMonitor::prime_pg_temp(
 {
   if (mon->monmap->get_required_features().contains_all(
         ceph::features::mon::FEATURE_LUMINOUS)) {
+    // TODO: remove this creating_pgs direct access?
     if (creating_pgs.pgs.count(pgid)) {
       return;
     }
   } else {
-    const auto& pg_map = mon->pgmon()->pg_map;
-    if (pg_map.creating_pgs.count(pgid)) {
+    if (mon->pgservice.is_creating_pg(pgid)) {
       return;
     }
   }
@@ -3963,9 +3963,8 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op)
   }
   else if (prefix == "osd perf" ||
           prefix == "osd blocked-by") {
-    const PGMap &pgm = mon->pgmon()->pg_map;
-    r = process_pg_map_command(prefix, cmdmap, pgm, osdmap,
-                              f.get(), &ss, &rdata);
+    r = process_pg_map_command(prefix, cmdmap, mon->pgservice.get_pg_map(),
+                              osdmap, f.get(), &ss, &rdata);
   }
   else if (prefix == "osd dump" ||
           prefix == "osd tree" ||
index 4478f976513c96e662f67c7012a2b213e201446b..660ad9e50f74f65a95b832542a88ecdd55bd7532 100644 (file)
@@ -62,6 +62,7 @@ public:
   float get_nearfull_ratio() const { return parent.nearfull_ratio; }
 
   bool have_creating_pgs() const { return !parent.creating_pgs.empty(); }
+  bool is_creating_pg(pg_t pgid) const { return parent.creating_pgs.count(pgid); }
   epoch_t get_min_last_epoch_clean() const { return parent.get_min_last_epoch_clean(); }
 
   bool have_full_osds() const { return !parent.full_osds.empty(); }