osd/PG: register recovery finish context directly on Transaction

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2018-02-09 16:02:08 -06:00
parent 643714ff96
commit 45e07480df
2 changed files with 5 additions and 4 deletions

View File

@ -2398,7 +2398,7 @@ unsigned PG::get_delete_priority()
}
}
void PG::finish_recovery(list<Context*>& tfin)
Context *PG::finish_recovery()
{
dout(10) << "finish_recovery" << dendl;
assert(info.last_complete == info.last_update);
@ -2409,7 +2409,7 @@ void PG::finish_recovery(list<Context*>& tfin)
* sync all this before purging strays. but don't block!
*/
finish_sync_event = new C_PG_FinishRecovery(this);
tfin.push_back(finish_sync_event);
return finish_sync_event;
}
void PG::_finish_recovery(Context *c)
@ -7760,7 +7760,8 @@ PG::RecoveryState::Clean::Clean(my_context ctx)
if (pg->info.last_complete != pg->info.last_update) {
ceph_abort();
}
pg->finish_recovery(*context< RecoveryMachine >().get_on_safe_context_list());
Context *c = pg->finish_recovery();
context< RecoveryMachine >().get_cur_transaction()->register_on_commit(c);
if (pg->is_active()) {
pg->mark_clean();

View File

@ -1504,7 +1504,7 @@ protected:
Context *finish_sync_event;
void finish_recovery(list<Context*>& tfin);
Context *finish_recovery();
void _finish_recovery(Context *c);
struct C_PG_FinishRecovery : public Context {
PGRef pg;