1
0
mirror of https://github.com/ceph/ceph synced 2024-12-26 13:33:57 +00:00

osd/ReplicatedPG: drop unnecessary cache_mode checks

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>
This commit is contained in:
Sage Weil 2014-11-17 12:46:51 -08:00
parent 2a67b0a090
commit a4a414944e

View 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;
}