]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG: snapset_obc -> head_obc
authorSage Weil <sage@redhat.com>
Fri, 1 Sep 2017 16:13:03 +0000 (12:13 -0400)
committerSage Weil <sage@redhat.com>
Thu, 21 Sep 2017 18:29:32 +0000 (14:29 -0400)
This is only used for trim_object, now!

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h

index 9a8523f1a609c2f65d2d6f63885c2e54b2bb1c2e..623d8620b0760aa6b9c64d86456d71077dd16567 100644 (file)
@@ -3629,7 +3629,7 @@ int PrimaryLogPG::trim_object(
   }
 
   OpContextUPtr ctx = simple_opc_create(obc);
-  ctx->snapset_obc = head_obc;
+  ctx->head_obc = head_obc;
 
   if (!ctx->lock_manager.get_snaptrimmer_write(
        coid,
@@ -9100,17 +9100,17 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx)
 
   ctx->obc->ondisk_write_lock();
 
-  bool unlock_snapset_obc = false;
+  bool unlock_head_obc = false;
   ctx->op_t->add_obc(ctx->obc);
   if (ctx->clone_obc) {
     ctx->clone_obc->ondisk_write_lock();
     ctx->op_t->add_obc(ctx->clone_obc);
   }
-  if (ctx->snapset_obc && ctx->snapset_obc->obs.oi.soid !=
-      ctx->obc->obs.oi.soid) {
-    ctx->snapset_obc->ondisk_write_lock();
-    unlock_snapset_obc = true;
-    ctx->op_t->add_obc(ctx->snapset_obc);
+  if (ctx->head_obc &&
+      ctx->head_obc->obs.oi.soid != ctx->obc->obs.oi.soid) {
+    ctx->head_obc->ondisk_write_lock();
+    unlock_head_obc = true;
+    ctx->op_t->add_obc(ctx->head_obc);
   }
 
   Context *on_all_commit = new C_OSD_RepopCommit(this, repop);
@@ -9118,7 +9118,7 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx)
   Context *onapplied_sync = new C_OSD_OndiskWriteUnlock(
     ctx->obc,
     ctx->clone_obc,
-    unlock_snapset_obc ? ctx->snapset_obc : ObjectContextRef());
+    unlock_head_obc ? ctx->head_obc : ObjectContextRef());
   if (!(ctx->log.empty())) {
     assert(ctx->at_version >= projected_last_update);
     projected_last_update = ctx->at_version;
index 51270e66efdde11c45188820e18013510629cfdc..e1d2614f24ae14facb01cee74993b5b34652a951 100644 (file)
@@ -536,7 +536,7 @@ public:
     interval_set<uint64_t> modified_ranges;
     ObjectContextRef obc;
     ObjectContextRef clone_obc;    // if we created a clone
-    ObjectContextRef snapset_obc;  // if we created/deleted a snapdir
+    ObjectContextRef head_obc;     // if we also update snapset (see trim_object)
 
     // FIXME: we may want to kill this msgr hint off at some point!
     boost::optional<int> data_off = boost::none;
@@ -756,7 +756,7 @@ protected:
    * @return true on success, false if we are queued
    */
   bool get_rw_locks(bool write_ordered, OpContext *ctx) {
-    /* If snapset_obc, !obc->obs->exists and we will always take the
+    /* If head_obc, !obc->obs->exists and we will always take the
      * snapdir lock *before* the head lock.  Since all callers will do
      * this (read or write) if we get the first we will be guaranteed
      * to get the second.
@@ -770,12 +770,12 @@ protected:
       ctx->lock_type = ObjectContext::RWState::RWREAD;
     }
 
-    if (ctx->snapset_obc) {
+    if (ctx->head_obc) {
       assert(!ctx->obc->obs.exists);
       if (!ctx->lock_manager.get_lock_type(
            ctx->lock_type,
-           ctx->snapset_obc->obs.oi.soid,
-           ctx->snapset_obc,
+           ctx->head_obc->obs.oi.soid,
+           ctx->head_obc,
            ctx->op)) {
        ctx->lock_type = ObjectContext::RWState::RWNONE;
        return false;
@@ -788,7 +788,7 @@ protected:
          ctx->op)) {
       return true;
     } else {
-      assert(!ctx->snapset_obc);
+      assert(!ctx->head_obc);
       ctx->lock_type = ObjectContext::RWState::RWNONE;
       return false;
     }