]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: move PG::publish_stats_to_osd() to .cc
authorKefu Chai <kchai@redhat.com>
Thu, 28 Jan 2021 04:32:43 +0000 (12:32 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 28 Jan 2021 04:56:24 +0000 (12:56 +0800)
and move PG::get_stats() to .cc as well

for faster compilation

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/osd/pg.cc
src/crimson/osd/pg.h

index 0f01c160783d280851bd25ee6bb69be22486345e..bb638f9a5524f60f4ac8f80e663100e7416e3285 100644 (file)
@@ -141,6 +141,27 @@ bool PG::try_flush_or_schedule_async() {
   return false;
 }
 
+void PG::publish_stats_to_osd()
+{
+  if (!is_primary())
+    return;
+
+  (void) peering_state.prepare_stats_for_publish(
+    false,
+    pg_stat_t(),
+    object_stat_collection_t());
+}
+
+pg_stat_t PG::get_stats()
+{
+  auto stats = peering_state.prepare_stats_for_publish(
+    false,
+    pg_stat_t(),
+    object_stat_collection_t());
+  ceph_assert(stats);
+  return *stats;
+}
+
 void PG::queue_check_readable(epoch_t last_peering_reset, ceph::timespan delay)
 {
   // handle the peering event in the background
index 34676ee7a1098877ed558cb95406a9707d65dbf1..f290a145963dc19859f5d9aa4b918610a4c70b7b 100644 (file)
@@ -274,15 +274,7 @@ public:
   void clear_want_pg_temp() final {
     shard_services.remove_want_pg_temp(pgid.pgid);
   }
-  void publish_stats_to_osd() final {
-    if (!is_primary())
-      return;
-
-    (void) peering_state.prepare_stats_for_publish(
-      false,
-      pg_stat_t(),
-      object_stat_collection_t());
-  }
+  void publish_stats_to_osd() final;
   void clear_publish_stats() final {
     // Not needed yet
   }
@@ -448,14 +440,7 @@ public:
   bool is_backfilling() const final {
     return peering_state.is_backfilling();
   }
-  pg_stat_t get_stats() {
-    auto stats = peering_state.prepare_stats_for_publish(
-      false,
-      pg_stat_t(),
-      object_stat_collection_t());
-    ceph_assert(stats);
-    return *stats;
-  }
+  pg_stat_t get_stats();
   bool get_need_up_thru() const {
     return peering_state.get_need_up_thru();
   }