From: Sage Weil Date: Mon, 17 Nov 2014 22:02:39 +0000 (-0800) Subject: osd/ReplicatedPG: separate promotion from the triggering op X-Git-Tag: v0.92~33^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9ed2ac780ec81858fc9230501ac84b631686ccd9;p=ceph.git osd/ReplicatedPG: separate promotion from the triggering op Remove the triggering op from the internal promote machinery. We keep the optional op arg to promote_object() only because we may block on an object other than the original obc. Signed-off-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index e51faade050..2de48e639c2 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1905,20 +1905,17 @@ void ReplicatedPG::do_cache_redirect(OpRequestRef op, ObjectContextRef obc) } class PromoteCallback: public ReplicatedPG::CopyCallback { - OpRequestRef op; ObjectContextRef obc; ReplicatedPG *pg; public: - PromoteCallback(OpRequestRef op_, ObjectContextRef obc_, - ReplicatedPG *pg_) - : op(op_), - obc(obc_), + PromoteCallback(ObjectContextRef obc_, ReplicatedPG *pg_) + : obc(obc_), pg(pg_) {} virtual void finish(ReplicatedPG::CopyCallbackResults results) { ReplicatedPG::CopyResults *results_data = results.get<1>(); int r = results.get<0>(); - pg->finish_promote(r, op, results_data, obc); + pg->finish_promote(r, results_data, obc); } }; @@ -1933,7 +1930,7 @@ void ReplicatedPG::promote_object(ObjectContextRef obc, } dout(10) << __func__ << " " << obc->obs.oi.soid << dendl; - PromoteCallback *cb = new PromoteCallback(op, obc, this); + PromoteCallback *cb = new PromoteCallback(obc, this); object_locator_t my_oloc = oloc; my_oloc.pool = pool.info.tier_of; start_copy(cb, obc, obc->obs.oi.soid, my_oloc, 0, @@ -6399,8 +6396,8 @@ void ReplicatedPG::finish_copyfrom(OpContext *ctx) osd->logger->inc(l_osd_copyfrom); } -void ReplicatedPG::finish_promote(int r, OpRequestRef op, - CopyResults *results, ObjectContextRef obc) +void ReplicatedPG::finish_promote(int r, CopyResults *results, + ObjectContextRef obc) { const hobject_t& soid = obc->obs.oi.soid; dout(10) << __func__ << " " << soid << " r=" << r diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index 39e50909638..62d9e11c0cf 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -1262,8 +1262,7 @@ protected: void _build_finish_copy_transaction(CopyOpRef cop, PGBackend::PGTransaction *t); void finish_copyfrom(OpContext *ctx); - void finish_promote(int r, OpRequestRef op, - CopyResults *results, ObjectContextRef obc); + void finish_promote(int r, CopyResults *results, ObjectContextRef obc); void cancel_copy(CopyOpRef cop, bool requeue); void cancel_copy_ops(bool requeue);