]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PrimaryLogPG: _delete_oid: drop legacy snapset handling
authorSage Weil <sage@redhat.com>
Fri, 1 Sep 2017 16:43:44 +0000 (12:43 -0400)
committerSage Weil <sage@redhat.com>
Thu, 21 Sep 2017 18:29:33 +0000 (14:29 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PrimaryLogPG.cc

index 54fd044186f4b12265cd01a2967c1c553c300c2d..f48200a9296471697f226f1d6cf79ad368053646 100644 (file)
@@ -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;
 }