Transaction &t,
laddr_t offset, extent_len_t length) = 0;
- /**
- * Fetches mappings for a list of laddr_t in range [offset, offset + len)
- *
- * Future will not resolve until all pins have resolved (set_paddr called)
- * For indirect lba mappings, get_mappings will always retrieve the original
- * lba value.
- */
- virtual get_mappings_ret get_mappings(
- Transaction &t,
- laddr_list_t &&extent_lisk) = 0;
-
/**
* Fetches the mapping for laddr_t
*
});
}
-
-BtreeLBAManager::get_mappings_ret
-BtreeLBAManager::get_mappings(
- Transaction &t,
- laddr_list_t &&list)
-{
- LOG_PREFIX(BtreeLBAManager::get_mappings);
- TRACET("{}", t, list);
- auto l = std::make_unique<laddr_list_t>(std::move(list));
- auto retptr = std::make_unique<lba_pin_list_t>();
- auto &ret = *retptr;
- return trans_intr::do_for_each(
- l->begin(),
- l->end(),
- [this, &t, &ret](const auto &p) {
- return this->get_mappings(t, p.first, p.second).si_then(
- [&ret](auto res) {
- ret.splice(ret.end(), res, res.begin(), res.end());
- return get_mappings_iertr::now();
- });
- }).si_then([l=std::move(l), retptr=std::move(retptr)]() mutable {
- return std::move(*retptr);
- });
-}
-
BtreeLBAManager::get_mapping_ret
BtreeLBAManager::get_mapping(
Transaction &t,
Transaction &t,
laddr_t offset, extent_len_t length) final;
- get_mappings_ret get_mappings(
- Transaction &t,
- laddr_list_t &&list) final;
-
get_mapping_ret get_mapping(
Transaction &t,
laddr_t offset) final;
-
struct alloc_mapping_info_t {
laddr_t key = L_ADDR_NULL; // once assigned, the allocation to
// key must be exact and successful