std::list<CachedExtentRef> res;
res.emplace_back(std::move(extent));
} else if (is_logical_type(type)) {
- auto pin_list = co_await lba_manager->get_mappings(
+ auto pin_list = co_await lba_manager->get_cursors(
t,
laddr,
len
);
auto paddr_seg_id = paddr.as_seg_paddr().get_segment_id();
for (auto &pin : pin_list) {
- DEBUGT("got pin, try read in parallel ... -- {}", t, pin);
- auto pin_paddr = pin.get_val();
+ ceph_assert(pin->is_direct());
+ DEBUGT("got pin, try read in parallel ... -- {}", t, *pin);
+ auto pin_paddr = pin->get_paddr();
if (!pin_paddr.is_absolute_segmented()) {
continue;
}
// recognize committed segments: https://tracker.ceph.com/issues/66941
// ceph_assert(pin_seg_paddr >= paddr &&
// pin_seg_paddr.add_offset(pin_len) <= paddr.add_offset(len));
- auto ret = co_await read_pin_by_type(t, std::move(pin), type);
+ auto ret = co_await read_cursor_by_type(t, std::move(pin), type);
res.emplace_back(std::move(ret));
}
DEBUGT("{} {}~0x{:x} {} is alive as {} extents",
t, cursor.ctx.cache, cursor.pos, cursor.key);
}
- base_iertr::future<LogicalChildNodeRef> read_pin_by_type(
+ base_iertr::future<LogicalChildNodeRef> read_cursor_by_type(
Transaction &t,
- LBAMapping pin,
+ LBACursorRef cursor,
extent_types_t type)
{
- ceph_assert(pin.is_viewable());
- assert(!pin.is_indirect());
+ assert(cursor->is_direct());
// Note: pin might be a clone
- auto v = pin.get_logical_extent(t);
+ auto v = get_extent_if_linked(t, *cursor);
// checking the lba child must be atomic with creating
// and linking the absent child
if (v.has_child()) {
ceph_assert(ext->get_type() == type);
co_return ext;
} else {
- auto extent = co_await pin_to_extent_by_type(
- t, pin, v.get_child_pos(), type);
+ auto extent = co_await cursor_to_extent_by_type(
+ t, cursor, v.get_child_pos(), type);
co_return extent;
}
}
}
/**
- * pin_to_extent_by_type
+ * cursor_to_extent_by_type
*
- * Get extent mapped at pin.
+ * Get extent mapped at cursor.
*/
- using pin_to_extent_by_type_ret = pin_to_extent_iertr::future<
+ using cursor_to_extent_by_type_ret = pin_to_extent_iertr::future<
LogicalChildNodeRef>;
- pin_to_extent_by_type_ret pin_to_extent_by_type(
+ cursor_to_extent_by_type_ret cursor_to_extent_by_type(
Transaction &t,
- LBAMapping pin,
+ LBACursorRef cursor,
child_pos_t<LBALeafNode> child_pos,
extent_types_t type)
{
- LOG_PREFIX(TransactionManager::pin_to_extent_by_type);
- SUBTRACET(seastore_tm, "getting absent extent from pin {} type {} ...",
- t, pin, type);
- assert(pin.is_viewable());
+ LOG_PREFIX(TransactionManager::cursor_to_extent_by_type);
+ SUBTRACET(seastore_tm, "getting absent extent from cursor {} type {} ...",
+ t, *cursor, type);
assert(is_logical_type(type));
assert(is_background_transaction(t.get_src()));
- laddr_t direct_key = pin.get_intermediate_base();
- extent_len_t direct_length = pin.get_intermediate_length();
+ ceph_assert(cursor->is_direct());
+ laddr_t direct_key = cursor->get_laddr();
+ extent_len_t direct_length = cursor->get_length();
auto ref = co_await cache->get_absent_extent_by_type(
t,
type,
- pin.get_val(),
+ cursor->get_paddr(),
direct_key,
direct_length,
// extent_init_func
// for background cleaning.
}
),
- pin.get_checksum());
+ cursor->get_checksum());
SUBDEBUGT(seastore_tm, "got extent -- {} fully_loaded: {}",
t, *ref, ref->is_fully_loaded());
assert(ref->is_fully_loaded());