From: Sage Weil Date: Fri, 1 Sep 2017 16:06:13 +0000 (-0400) Subject: osd/PrimaryLogPG: trim_object: simplify a bit more for post-snapdir world X-Git-Tag: v13.0.1~840^2~25 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a53e731f8f12e8ab1d775c29cb00c0170ec821e2;p=ceph.git osd/PrimaryLogPG: trim_object: simplify a bit more for post-snapdir world Signed-off-by: Sage Weil --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 20d89007fe10..3cb77cb1377d 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -3767,10 +3767,9 @@ int PrimaryLogPG::trim_object( dout(10) << coid << " new snapset " << snapset << " on " << head_obc->obs.oi << dendl; if (snapset.clones.empty() && - (!snapset.head_exists || - (head_obc->obs.oi.is_whiteout() && - !(head_obc->obs.oi.is_dirty() && pool.info.is_tier()) && - !head_obc->obs.oi.is_cache_pinned()))) { + (head_obc->obs.oi.is_whiteout() && + !(head_obc->obs.oi.is_dirty() && pool.info.is_tier()) && + !head_obc->obs.oi.is_cache_pinned())) { // NOTE: this arguably constitutes minor interference with the // tiering agent if this is a cache tier since a snap trim event // is effectively evicting a whiteout we might otherwise want to @@ -3787,22 +3786,20 @@ int PrimaryLogPG::trim_object( ctx->mtime, 0) ); - if (head_oid.is_head()) { - derr << "removing snap head" << dendl; - object_info_t& oi = ctx->snapset_obc->obs.oi; - ctx->delta_stats.num_objects--; - if (oi.is_dirty()) { - ctx->delta_stats.num_objects_dirty--; - } - if (oi.is_omap()) - ctx->delta_stats.num_objects_omap--; - if (oi.is_whiteout()) { - dout(20) << __func__ << " trimming whiteout on " << oi.soid << dendl; - ctx->delta_stats.num_whiteouts--; - } - if (oi.is_cache_pinned()) { - ctx->delta_stats.num_objects_pinned--; - } + derr << "removing snap head" << dendl; + object_info_t& oi = ctx->snapset_obc->obs.oi; + ctx->delta_stats.num_objects--; + if (oi.is_dirty()) { + ctx->delta_stats.num_objects_dirty--; + } + if (oi.is_omap()) + ctx->delta_stats.num_objects_omap--; + if (oi.is_whiteout()) { + dout(20) << __func__ << " trimming whiteout on " << oi.soid << dendl; + ctx->delta_stats.num_whiteouts--; + } + if (oi.is_cache_pinned()) { + ctx->delta_stats.num_objects_pinned--; } ctx->snapset_obc->obs.exists = false; ctx->snapset_obc->obs.oi = object_info_t(head_oid);