From 45e07480df2748a7671b905495951d1db68eabf4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 9 Feb 2018 16:02:08 -0600 Subject: [PATCH] osd/PG: register recovery finish context directly on Transaction Signed-off-by: Sage Weil --- src/osd/PG.cc | 7 ++++--- src/osd/PG.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index c9b533cbf247e..3152e923f00d9 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2398,7 +2398,7 @@ unsigned PG::get_delete_priority() } } -void PG::finish_recovery(list& 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& 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(); diff --git a/src/osd/PG.h b/src/osd/PG.h index de0e8b83289ef..c05b211e9f48f 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1504,7 +1504,7 @@ protected: Context *finish_sync_event; - void finish_recovery(list& tfin); + Context *finish_recovery(); void _finish_recovery(Context *c); struct C_PG_FinishRecovery : public Context { PGRef pg; -- 2.39.5