]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG:: s/_delete_head/_delete_oid, adjust head_exists iff is_head 1554/head
authorSamuel Just <sam.just@inktank.com>
Wed, 26 Mar 2014 21:08:23 +0000 (14:08 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 26 Mar 2014 22:51:03 +0000 (15:51 -0700)
Fixes: #7872
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h

index faf00a720acac08de328df8a5acf0b41401d678b..06385705ca4edcab192adbb361acef1afeb7658a 100644 (file)
@@ -3247,7 +3247,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
          if (result < 0)
            break;
        }
-       result = _delete_head(ctx, true);
+       result = _delete_oid(ctx, true);
        osd->logger->inc(l_osd_tier_evict);
       }
       break;
@@ -3803,7 +3803,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
        // Cannot delete an object with watchers
        result = -EBUSY;
       } else {
-       result = _delete_head(ctx, false);
+       result = _delete_oid(ctx, false);
       }
       break;
 
@@ -4470,7 +4470,7 @@ int ReplicatedPG::_verify_no_head_clones(const hobject_t& soid,
   return 0;
 }
 
-inline int ReplicatedPG::_delete_head(OpContext *ctx, bool no_whiteout)
+inline int ReplicatedPG::_delete_oid(OpContext *ctx, bool no_whiteout)
 {
   SnapSet& snapset = ctx->new_snapset;
   ObjectState& obs = ctx->new_obs;
@@ -4519,7 +4519,8 @@ inline int ReplicatedPG::_delete_head(OpContext *ctx, bool no_whiteout)
     dout(20) << __func__ << " deleting whiteout on " << soid << dendl;
     ctx->delta_stats.num_whiteouts--;
   }
-  snapset.head_exists = false;
+  if (soid.is_head())
+    snapset.head_exists = false;
   obs.exists = false;
   return 0;
 }
@@ -4564,7 +4565,7 @@ int ReplicatedPG::_rollback_to(OpContext *ctx, ceph_osd_op& op)
       // Cannot delete an object with watchers
       ret = -EBUSY;
     } else {
-      _delete_head(ctx, false);
+      _delete_oid(ctx, false);
       ret = 0;
     }
   } else if (ret) {
@@ -10834,7 +10835,7 @@ bool ReplicatedPG::agent_maybe_evict(ObjectContextRef& obc)
   OpContext *ctx = repop->ctx;
   ctx->at_version = get_next_version();
   assert(ctx->new_obs.exists);
-  int r = _delete_head(ctx, true);
+  int r = _delete_oid(ctx, true);
   assert(r == 0);
   finish_ctx(ctx, pg_log_entry_t::DELETE);
   simple_repop_submit(repop);
index 3b8dea67becdff8e0cacbc65bad768e60ae664ce..13dbc7f96940dc64d76df54c64d42891508968d8 100644 (file)
@@ -1316,7 +1316,7 @@ private:
 
   int _verify_no_head_clones(const hobject_t& soid,
                             const SnapSet& ss);
-  int _delete_head(OpContext *ctx, bool no_whiteout);
+  int _delete_oid(OpContext *ctx, bool no_whiteout);
   int _rollback_to(OpContext *ctx, ceph_osd_op& op);
 public:
   bool same_for_read_since(epoch_t e);