From: Sage Weil Date: Fri, 1 Sep 2017 16:43:44 +0000 (-0400) Subject: osd/PrimaryLogPG: _delete_oid: drop legacy snapset handling X-Git-Tag: v13.0.1~840^2~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3671bef26b49a4c9a2115147cf0bee5c57d7f472;p=ceph.git osd/PrimaryLogPG: _delete_oid: drop legacy snapset handling Signed-off-by: Sage Weil --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 54fd044186f4..f48200a92964 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -6680,25 +6680,20 @@ inline int PrimaryLogPG::_delete_oid( && !try_no_whiteout) { whiteout = true; } - bool legacy; - if (get_osdmap()->require_osd_release >= CEPH_RELEASE_LUMINOUS) { - legacy = false; - // in luminous or later, we can't delete the head if there are - // clones. we trust the caller passing no_whiteout has already - // verified they don't exist. - if (!snapset.clones.empty() || - (!ctx->snapc.snaps.empty() && ctx->snapc.snaps[0] > snapset.seq)) { - if (no_whiteout) { - dout(20) << __func__ << " has or will have clones but no_whiteout=1" - << dendl; - } else { - dout(20) << __func__ << " has or will have clones; will whiteout" - << dendl; - whiteout = true; - } + + // in luminous or later, we can't delete the head if there are + // clones. we trust the caller passing no_whiteout has already + // verified they don't exist. + if (!snapset.clones.empty() || + (!ctx->snapc.snaps.empty() && ctx->snapc.snaps[0] > snapset.seq)) { + if (no_whiteout) { + dout(20) << __func__ << " has or will have clones but no_whiteout=1" + << dendl; + } else { + dout(20) << __func__ << " has or will have clones; will whiteout" + << dendl; + whiteout = true; } - } else { - legacy = false; } dout(20) << __func__ << " " << soid << " whiteout=" << (int)whiteout << " no_whiteout=" << (int)no_whiteout @@ -6757,9 +6752,6 @@ inline int PrimaryLogPG::_delete_oid( if (oi.is_cache_pinned()) { ctx->delta_stats.num_objects_pinned--; } - if ((legacy || snapset.is_legacy()) && soid.is_head()) { - snapset.head_exists = false; - } obs.exists = false; return 0; }