From: Kefu Chai Date: Thu, 28 Jan 2021 04:32:43 +0000 (+0800) Subject: crimson/osd: move PG::publish_stats_to_osd() to .cc X-Git-Tag: v17.1.0~3115^2~8 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1db84298944927166f97ae3c46bfa7c0da8ac6fa;p=ceph.git crimson/osd: move PG::publish_stats_to_osd() to .cc and move PG::get_stats() to .cc as well for faster compilation Signed-off-by: Kefu Chai --- diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 0f01c160783d2..bb638f9a5524f 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -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 diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index 34676ee7a1098..f290a145963dc 100644 --- a/src/crimson/osd/pg.h +++ b/src/crimson/osd/pg.h @@ -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(); }