From 27905fdb80d1223663a31ab5ae3d9b55cc1092fd Mon Sep 17 00:00:00 2001 From: David Zafman Date: Tue, 10 Feb 2015 20:24:22 -0800 Subject: [PATCH] osd: Simplify handle_watch_timeout() using existing support functions Signed-off-by: David Zafman --- src/osd/ReplicatedPG.cc | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 7877b2e07ecd8..5fb847a219c02 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -7954,12 +7954,8 @@ void ReplicatedPG::handle_watch_timeout(WatchRef watch) return; } - vector ops; - ceph_tid_t rep_tid = osd->get_tid(); - osd_reqid_t reqid(osd->get_cluster_msgr_name(), 0, rep_tid); - OpContext *ctx = new OpContext(OpRequestRef(), reqid, ops, obc, this); - ctx->op_t = pgbackend->get_transaction(); - ctx->mtime = ceph_clock_now(cct); + RepGather *repop = simple_repop_create(obc); + OpContext *ctx = repop->ctx; ctx->at_version = get_next_version(); object_info_t& oi = ctx->new_obs.oi; @@ -7971,7 +7967,6 @@ void ReplicatedPG::handle_watch_timeout(WatchRef watch) entity_inst_t nobody; - RepGather *repop = new_repop(ctx, obc, rep_tid); PGBackend::PGTransaction *t = ctx->op_t; ctx->log.push_back(pg_log_entry_t(pg_log_entry_t::MODIFY, obc->obs.oi.soid, ctx->at_version, @@ -7994,9 +7989,7 @@ void ReplicatedPG::handle_watch_timeout(WatchRef watch) } // obc ref swallowed by repop! - issue_repop(repop, repop->ctx->mtime); - eval_repop(repop); - repop->put(); + simple_repop_submit(repop); } ObjectContextRef ReplicatedPG::create_object_context(const object_info_t& oi, -- 2.39.5