From: Sage Weil Date: Sat, 17 Jan 2015 18:30:47 +0000 (-0800) Subject: osd/ReplicatedPG: skip all of maybe_handle_cache if caching is off X-Git-Tag: v0.93~259^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F3395%2Fhead;p=ceph.git osd/ReplicatedPG: skip all of maybe_handle_cache if caching is off Return quickly and avoid all of the checks. Signed-off-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 3ece9be97d4d..dfb8914870a7 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1738,6 +1738,10 @@ bool ReplicatedPG::maybe_handle_cache(OpRequestRef op, bool must_promote, bool in_hit_set) { + // return quickly if caching is not enabled + if (pool.info.cache_mode == pg_pool_t::CACHEMODE_NONE) + return false; + if (obc) dout(25) << __func__ << " " << obc->obs.oi << " " << (obc->obs.exists ? "exists" : "DNE") @@ -1773,9 +1777,6 @@ bool ReplicatedPG::maybe_handle_cache(OpRequestRef op, } switch (pool.info.cache_mode) { - case pg_pool_t::CACHEMODE_NONE: - return false; - case pg_pool_t::CACHEMODE_WRITEBACK: if (agent_state && agent_state->evict_mode == TierAgentState::EVICT_MODE_FULL) {