From: Sage Weil Date: Fri, 15 Sep 2017 14:17:07 +0000 (-0400) Subject: osd/PrimaryLogPG: move cache_mode==none check to top X-Git-Tag: v13.0.1~729^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5a26ac4d0f643f90d1f513ee33081faa9b0a7e7d;p=ceph.git osd/PrimaryLogPG: move cache_mode==none check to top Signed-off-by: Sage Weil --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 95a442e0470e..223384b5909d 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -2430,6 +2430,10 @@ PrimaryLogPG::cache_result_t PrimaryLogPG::maybe_handle_cache_detail( bool in_hit_set, ObjectContextRef *promote_obc) { + // return quickly if caching is not enabled + if (pool.info.cache_mode == pg_pool_t::CACHEMODE_NONE) + return cache_result_t::NOOP; + if (op && op->get_req() && op->get_req()->get_type() == CEPH_MSG_OSD_OP && @@ -2438,9 +2442,6 @@ PrimaryLogPG::cache_result_t PrimaryLogPG::maybe_handle_cache_detail( dout(20) << __func__ << ": ignoring cache due to flag" << dendl; return cache_result_t::NOOP; } - // return quickly if caching is not enabled - if (pool.info.cache_mode == pg_pool_t::CACHEMODE_NONE) - return cache_result_t::NOOP; must_promote = must_promote || op->need_promote();