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 <sage@redhat.com>
This commit is contained in:
Sage Weil 2017-09-13 18:14:59 -04:00
parent 059158569c
commit ca4ba9b4f6
2 changed files with 7 additions and 10 deletions

View File

@ -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)) {

View File

@ -1187,9 +1187,14 @@ protected:
Context *finish_sync_event;
void finish_recovery(list<Context*>& 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;