});
}
-BtreeLBAManager::refresh_lba_mapping_ret
-BtreeLBAManager::refresh_lba_mapping(Transaction &t, LBAMapping mapping)
-{
- if (mapping.is_viewable()) {
- return refresh_lba_mapping_iertr::make_ready_future<
- LBAMapping>(std::move(mapping));
- }
- auto c = get_context(t);
- return with_btree_state<LBABtree, LBAMapping>(
- cache,
- c,
- std::move(mapping),
- [](LBABtree &btree, LBAMapping &mapping) mutable
- {
- return seastar::futurize_invoke([&mapping] {
- if (mapping.direct_cursor) {
- return mapping.direct_cursor->refresh();
- }
- return base_iertr::now();
- }).si_then([&mapping] {
- if (mapping.indirect_cursor) {
- return mapping.indirect_cursor->refresh();
- }
- return base_iertr::now();
-#ifndef NDEBUG
- }).si_then([&mapping] {
- assert(mapping.is_viewable());
-#endif
- });
- });
-}
-
void BtreeLBAManager::register_metrics()
{
LOG_PREFIX(BtreeLBAManager::register_metrics);
laddr_t laddr,
extent_len_t len) final;
- refresh_lba_mapping_ret refresh_lba_mapping(
- Transaction &t,
- LBAMapping mapping) final;
-
private:
Cache &cache;
laddr_t laddr,
extent_len_t len) = 0;
- using refresh_lba_mapping_iertr = base_iertr;
- using refresh_lba_mapping_ret = refresh_lba_mapping_iertr::future<LBAMapping>;
- virtual refresh_lba_mapping_ret refresh_lba_mapping(
- Transaction &t,
- LBAMapping mapping) = 0;
-
virtual ~LBAManager() {}
};
using LBAManagerRef = std::unique_ptr<LBAManager>;
SUBDEBUGT(seastore_tm, "{} {} 0x{:x}~0x{:x} direct_off=0x{:x} ...",
t, T::TYPE, pin, partial_off, partial_len, direct_partial_off);
- return lba_manager->refresh_lba_mapping(t, std::move(pin)
+ return pin.refresh(
).si_then([&t, this, direct_partial_off, partial_len,
maybe_init=std::move(maybe_init)](auto npin) mutable {
// checking the lba child must be atomic with creating
}
LBAMapping refresh_lba_mapping(test_transaction_t &t, LBAMapping mapping) {
- return with_trans_intr(*t.t, [this, mapping=std::move(mapping)](auto &t) mutable {
- return lba_manager->refresh_lba_mapping(t, std::move(mapping));
+ return with_trans_intr(*t.t, [mapping=std::move(mapping)](auto &t) mutable {
+ return mapping.refresh();
}).unsafe_get();
}