From: xie xingguo Date: Mon, 23 May 2016 08:26:02 +0000 (+0800) Subject: osd/ReplicatedPG: remove redundant transient variables did_proxy_read X-Git-Tag: v11.0.0~58^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c191fa109f9e5683463e47cb74cc4c451b49399f;p=ceph.git osd/ReplicatedPG: remove redundant transient variables did_proxy_read Because it is always set to true unconditionally. Signed-off-by: xie xingguo --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index a82fab7d6edc..beeb2c2b33fa 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -2238,37 +2238,23 @@ ReplicatedPG::cache_result_t ReplicatedPG::maybe_handle_cache_detail( } return cache_result_t::HANDLED_PROXY; } else { - bool did_proxy_read = false; do_proxy_read(op); - did_proxy_read = true; // Avoid duplicate promotion if (obc.get() && obc->is_blocked()) { - if (!did_proxy_read) { - wait_for_blocked_object(obc->obs.oi.soid, op); - } if (promote_obc) *promote_obc = obc; return cache_result_t::BLOCKED_PROMOTE; } // Promote too? - bool promoted = false; if (!op->need_skip_promote()) { - promoted = maybe_promote(obc, missing_oid, oloc, in_hit_set, - pool.info.min_read_recency_for_promote, - promote_op, promote_obc); - } - if (!promoted && !did_proxy_read) { - // redirect the op if it's not proxied and not promoting - do_cache_redirect(op); - return cache_result_t::HANDLED_REDIRECT; - } else if (did_proxy_read) { - return cache_result_t::HANDLED_PROXY; - } else { - assert(promoted); - return cache_result_t::BLOCKED_PROMOTE; + (void)maybe_promote(obc, missing_oid, oloc, in_hit_set, + pool.info.min_read_recency_for_promote, + promote_op, promote_obc); } + + return cache_result_t::HANDLED_PROXY; } assert(0 == "unreachable"); return cache_result_t::NOOP;