]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: use simple_repop_{create,submit} for finish_promote
authorSage Weil <sage@inktank.com>
Tue, 22 Oct 2013 22:12:38 +0000 (15:12 -0700)
committerSage Weil <sage@inktank.com>
Sat, 14 Dec 2013 00:35:52 +0000 (16:35 -0800)
Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/ReplicatedPG.cc

index 7eb14f5b882c4d3b9fc9a4f900b8dfa788c16df2..9155a90a84901834f23b3f4bc92b94fd19513ca9 100644 (file)
@@ -4627,19 +4627,13 @@ void ReplicatedPG::finish_promote(int r, OpRequestRef op,
     return;
   }
 
-  vector<OSDOp> ops;
-  tid_t rep_tid = osd->get_tid();
-  osd_reqid_t reqid(osd->get_cluster_msgr_name(), 0, rep_tid);
-  OpContext *tctx = new OpContext(OpRequestRef(), reqid, ops, &obc->obs, obc->ssc, this);
-  tctx->mtime = ceph_clock_now(g_ceph_context);
+  RepGather *repop = simple_repop_create(obc);
+  OpContext *tctx = repop->ctx;
   tctx->op_t.swap(results->final_tx);
   if (results->started_temp_obj) {
-       tctx->discard_temp_oid = temp_obj;
+    tctx->discard_temp_oid = temp_obj;
   }
 
-  RepGather *repop = new_repop(tctx, obc, rep_tid);
-  C_KickBlockedObject *blockedcb = new C_KickBlockedObject(obc, this);
-  repop->ondone = blockedcb;
   object_stat_sum_t delta;
   ++delta.num_objects;
   obc->obs.exists = true;
@@ -4658,10 +4652,9 @@ void ReplicatedPG::finish_promote(int r, OpRequestRef op,
          tctx->user_at_version,
          osd_reqid_t(),
          repop->ctx->mtime));
-  append_log(tctx->log, eversion_t(), tctx->local_t);
-  issue_repop(repop, repop->ctx->mtime);
-  eval_repop(repop);
-  repop->put();
+
+  repop->ondone = new C_KickBlockedObject(obc, this);
+  simple_repop_submit(repop);
 }
 
 void ReplicatedPG::cancel_copy(CopyOpRef cop, bool requeue)