From ca4ba9b4f67ea05d6f494437e884ec66b69f8915 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 13 Sep 2017 18:14:59 -0400 Subject: [PATCH] osd/PG: move C_PG_FinishRecovery into header Less code than delcaring it in 2 places (by making it a friend). Signed-off-by: Sage Weil --- src/osd/PG.cc | 8 -------- src/osd/PG.h | 9 +++++++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index a56de2ff863..0c8556a456f 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1988,14 +1988,6 @@ unsigned PG::get_scrub_priority() return pool_scrub_priority > 0 ? pool_scrub_priority : cct->_conf->osd_scrub_priority; } -struct C_PG_FinishRecovery : public Context { - PGRef pg; - explicit C_PG_FinishRecovery(PG *p) : pg(p) {} - void finish(int r) override { - pg->_finish_recovery(this); - } -}; - void PG::mark_clean() { if (actingset.size() == get_osdmap()->get_pg_size(info.pgid.pgid)) { diff --git a/src/osd/PG.h b/src/osd/PG.h index c223f3850d2..966d0a42803 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1187,9 +1187,14 @@ protected: Context *finish_sync_event; void finish_recovery(list& tfin); -public: void _finish_recovery(Context *c); -protected: + struct C_PG_FinishRecovery : public Context { + PGRef pg; + explicit C_PG_FinishRecovery(PG *p) : pg(p) {} + void finish(int r) override { + pg->_finish_recovery(this); + } + }; void cancel_recovery(); void clear_recovery_state(); virtual void _clear_recovery_state() = 0;