]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: register recovery finish context directly on Transaction
authorSage Weil <sage@redhat.com>
Fri, 9 Feb 2018 22:02:08 +0000 (16:02 -0600)
committerSage Weil <sage@redhat.com>
Wed, 4 Apr 2018 13:26:54 +0000 (08:26 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.cc
src/osd/PG.h

index c9b533cbf247e5cb1bd290cc2a1afa122141534a..3152e923f00d9c64fa0bf6ba38636c455684cc69 100644 (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();
index de0e8b83289ef957b10b4fbb83a046dc8fbed1a6..c05b211e9f48f53f397d98f2e29322a527abd0cf 100644 (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;