]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: skip all of maybe_handle_cache if caching is off 3395/head
authorSage Weil <sage@redhat.com>
Sat, 17 Jan 2015 18:30:47 +0000 (10:30 -0800)
committerSage Weil <sage@redhat.com>
Sat, 17 Jan 2015 18:31:10 +0000 (10:31 -0800)
Return quickly and avoid all of the checks.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/ReplicatedPG.cc

index 3ece9be97d4d5968aa6e0bae6c53002af022b0d3..dfb8914870a72a9644901c8f545bdd17c9c82cf6 100644 (file)
@@ -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) {