]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: drop unnecessary cache_mode checks
authorSage Weil <sage@redhat.com>
Mon, 17 Nov 2014 20:46:51 +0000 (12:46 -0800)
committerSage Weil <sage@redhat.com>
Sun, 11 Jan 2015 04:35:03 +0000 (20:35 -0800)
This currently enumerates all cache modes except none, and we don't
arrive in this function when caching is disabled.  And creating a whiteout
is not cache_mode dependent.  Simplify!

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

index 1c60a059e017f75eb8493a13ade06d52a8e4d7f2..b67cd7644c3db4d09740f5e17e80321fcb1533b3 100644 (file)
@@ -6456,11 +6456,8 @@ void ReplicatedPG::finish_promote(int r, OpRequestRef op,
   }
 
   bool whiteout = false;
-  if (r == -ENOENT &&
-      soid.snap == CEPH_NOSNAP &&
-      (pool.info.cache_mode == pg_pool_t::CACHEMODE_WRITEBACK ||
-       pool.info.cache_mode == pg_pool_t::CACHEMODE_READFORWARD ||
-       pool.info.cache_mode == pg_pool_t::CACHEMODE_READONLY)) {
+  if (r == -ENOENT) {
+    assert(soid.snap == CEPH_NOSNAP); // snap case is above
     dout(10) << __func__ << " whiteout " << soid << dendl;
     whiteout = true;
   }