btree_pin_set_t pin_set;
op_context_t get_context(Transaction &t) {
- return op_context_t{cache, pin_set, t};
+ return op_context_t{cache, t, &pin_set};
}
static btree_range_pin_t &get_pin(CachedExtent &e);
void btree_range_pin_t::take_pin(btree_range_pin_t &other)
{
ceph_assert(other.extent);
- ceph_assert(other.pins);
- other.pins->replace_pin(*this, other);
- pins = other.pins;
- other.pins = nullptr;
-
- if (other.has_ref()) {
- other.drop_ref();
- acquire_ref();
+ if (other.pins) {
+ other.pins->replace_pin(*this, other);
+ pins = other.pins;
+ other.pins = nullptr;
+
+ if (other.has_ref()) {
+ other.drop_ref();
+ acquire_ref();
+ }
}
}
iter.get_val().paddr == logn->get_paddr()) {
logn->set_pin(iter.get_pin());
ceph_assert(iter.get_val().len == e->get_length());
- c.pins.add_pin(
- static_cast<BtreeLBAPin&>(logn->get_pin()).pin);
+ if (c.pins) {
+ c.pins->add_pin(
+ static_cast<BtreeLBAPin&>(logn->get_pin()).pin);
+ }
DEBUGT("logical extent {} live, initialized", c.trans, *logn);
return e;
} else {
ceph_assert(depth == meta.depth);
if (!ret->is_pending() && !ret->pin.is_linked()) {
ret->pin.set_range(meta);
- c.pins.add_pin(ret->pin);
+ if (c.pins) {
+ c.pins->add_pin(ret->pin);
+ }
}
return get_internal_node_ret(
interruptible::ready_future_marker{},
ceph_assert(1 == meta.depth);
if (!ret->is_pending() && !ret->pin.is_linked()) {
ret->pin.set_range(meta);
- c.pins.add_pin(ret->pin);
+ if (c.pins) {
+ c.pins->add_pin(ret->pin);
+ }
}
return get_leaf_node_ret(
interruptible::ready_future_marker{},