*/
using initialize_omap_iertr = base_iertr;
using initialize_omap_ret = initialize_omap_iertr::future<omap_root_t>;
- virtual initialize_omap_ret initialize_omap(Transaction &t, laddr_t hint,
+ virtual initialize_omap_ret initialize_omap(
+ Transaction &t,
+ laddr_hint_t hint,
omap_type_t type) = 0;
/**
: tm(tm) {}
BtreeOMapManager::initialize_omap_ret
-BtreeOMapManager::initialize_omap(Transaction &t, laddr_t hint,
+BtreeOMapManager::initialize_omap(
+ Transaction &t,
+ laddr_hint_t hint,
omap_type_t type)
{
LOG_PREFIX(BtreeOMapManager::initialize_omap);
omap_node_meta_t meta{1};
root_extent->set_meta(meta);
omap_root_t omap_root;
- omap_root.update(root_extent->get_laddr(), 1, hint, type);
+ laddr_t root_laddr = root_extent->get_laddr();
+ auto new_hint = laddr_hint_t::create_object_md_hint(
+ root_laddr.get_clone_prefix(), hint.block_size);
+ omap_root.update(root_laddr, 1, new_hint, type);
t.get_omap_tree_stats().depth = 1u;
t.get_omap_tree_stats().extents_num_delta++;
return initialize_omap_iertr::make_ready_future<omap_root_t>(omap_root);
).si_then([&omap_root] (auto ret) {
omap_root.update(
L_ADDR_NULL,
- 0, L_ADDR_MIN, omap_root.get_type());
+ 0, LADDR_HINT_NULL, omap_root.get_type());
return omap_clear_iertr::now();
});
}).handle_error_interruptible(
public:
explicit BtreeOMapManager(TransactionManager &tm);
- initialize_omap_ret initialize_omap(Transaction &t, laddr_t hint,
+ initialize_omap_ret initialize_omap(
+ Transaction &t,
+ laddr_hint_t hint,
omap_type_t type) final;
omap_get_value_ret omap_get_value(
struct omap_context_t {
TransactionManager &tm;
Transaction &t;
- laddr_t hint;
+ laddr_hint_t hint;
omap_type_t type;
};
std::optional<laddr_t> prefix = std::nullopt;
const auto &layout = get_layout();
- auto omap_root = layout.omap_root.get(L_ADDR_NULL);
+ auto omap_root = layout.omap_root.get(LADDR_HINT_NULL);
if (!omap_root.is_null()) {
prefix.emplace(omap_root.addr.get_clone_prefix());
}
- auto log_root = layout.log_root.get(L_ADDR_NULL);
+ auto log_root = layout.log_root.get(LADDR_HINT_NULL);
if (!log_root.is_null()) {
auto laddr = log_root.addr.get_clone_prefix();
if (prefix) {
}
}
- auto xattr_root = layout.xattr_root.get(L_ADDR_NULL);
+ auto xattr_root = layout.xattr_root.get(LADDR_HINT_NULL);
if (!xattr_root.is_null()) {
auto laddr = xattr_root.addr.get_clone_prefix();
if (prefix) {
struct omap_root_t {
laddr_t addr = L_ADDR_NULL;
depth_t depth = 0;
- laddr_t hint = L_ADDR_MIN;
+ laddr_hint_t hint = LADDR_HINT_NULL;
bool mutated = false;
omap_type_t type = omap_type_t::NONE;
omap_root_t() = default;
- omap_root_t(laddr_t addr, depth_t depth, laddr_t addr_min, omap_type_t type)
+ omap_root_t(laddr_t addr, depth_t depth, laddr_hint_t hint, omap_type_t type)
: addr(addr),
depth(depth),
- hint(addr_min),
+ hint(hint),
type(type) {}
omap_root_t(const omap_root_t &o) = default;
return mutated;
}
- void update(laddr_t _addr, depth_t _depth, laddr_t _hint, omap_type_t _type) {
+ void update(laddr_t _addr, depth_t _depth, laddr_hint_t _hint, omap_type_t _type) {
mutated = true;
addr = _addr;
depth = _depth;
return depth;
}
- laddr_t get_hint() const {
+ laddr_hint_t get_hint() const {
return hint;
}
type = nroot.get_type();
}
- omap_root_t get(laddr_t hint) const {
+ omap_root_t get(laddr_hint_t hint) const {
return omap_root_t(addr, depth, hint, type);
}
omap_root_t omap_root = with_trans_intr(
*t,
[this](auto &t) {
- return omap_manager->initialize_omap(t, L_ADDR_MIN,
+ auto hint = laddr_hint_t::create_global_md_hint();
+ return omap_manager->initialize_omap(t, hint,
omap_type_t::OMAP);
}).unsafe_get();
submit_transaction(std::move(t));