]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Simplify handle_watch_timeout() using existing support functions
authorDavid Zafman <dzafman@redhat.com>
Wed, 11 Feb 2015 04:24:22 +0000 (20:24 -0800)
committerDavid Zafman <dzafman@redhat.com>
Wed, 11 Feb 2015 04:24:22 +0000 (20:24 -0800)
Signed-off-by: David Zafman <dzafman@redhat.com>
src/osd/ReplicatedPG.cc

index 7877b2e07ecd85c2c0ce2739bd445b814f401214..5fb847a219c0294ecf919848be45f281ec8475e4 100644 (file)
@@ -7954,12 +7954,8 @@ void ReplicatedPG::handle_watch_timeout(WatchRef watch)
     return;
   }
 
-  vector<OSDOp> 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,