}
OpContextUPtr ctx = simple_opc_create(obc);
- ctx->snapset_obc = head_obc;
+ ctx->head_obc = head_obc;
if (!ctx->lock_manager.get_snaptrimmer_write(
coid,
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);
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;
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;
* @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.
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;
ctx->op)) {
return true;
} else {
- assert(!ctx->snapset_obc);
+ assert(!ctx->head_obc);
ctx->lock_type = ObjectContext::RWState::RWNONE;
return false;
}