From b01783fb978c20da1404625f3a231ff7f87a1a16 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 1 Sep 2017 12:13:03 -0400 Subject: [PATCH] osd/PrimaryLogPG: snapset_obc -> head_obc This is only used for trim_object, now! Signed-off-by: Sage Weil --- src/osd/PrimaryLogPG.cc | 16 ++++++++-------- src/osd/PrimaryLogPG.h | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 9a8523f1a60..623d8620b07 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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; diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index 51270e66efd..e1d2614f24a 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -536,7 +536,7 @@ public: interval_set 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 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; } -- 2.39.5