summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-10-22 15:12:38 -0700
committerSage Weil <sage@inktank.com>2013-10-22 15:12:38 -0700
commitacee3f2da5fdaa57940ef0b1788897a7d4c8b958 (patch)
treeb769c1f9980088f4d65a1fbfcebb94c5a4390cc2
parent67f3143164b951abcdb0ec8733a1f94589378c86 (diff)
downloadceph-acee3f2da5fdaa57940ef0b1788897a7d4c8b958.tar.gz
osd/ReplicatedPG: use simple_repop_{create,submit} for finish_promote
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/osd/ReplicatedPG.cc19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index fdae2e1aa43..6a32a9f49cc 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -4613,19 +4613,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;
@@ -4644,10 +4638,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)