*/
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) = 0;
+ virtual initialize_omap_ret initialize_omap(Transaction &t, laddr_t hint,
+ omap_type_t type) = 0;
/**
* get value(string) by key(string)
: tm(tm) {}
BtreeOMapManager::initialize_omap_ret
-BtreeOMapManager::initialize_omap(Transaction &t, laddr_t hint)
+BtreeOMapManager::initialize_omap(Transaction &t, laddr_t hint,
+ omap_type_t type)
{
LOG_PREFIX(BtreeOMapManager::initialize_omap);
DEBUGT("hint: {}", t, hint);
return tm.alloc_non_data_extent<OMapLeafNode>(t, hint, OMAP_LEAF_BLOCK_SIZE)
- .si_then([hint, &t](auto&& root_extent) {
+ .si_then([hint, &t, type](auto&& root_extent) {
root_extent->set_size(0);
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);
+ omap_root.update(root_extent->get_laddr(), 1, 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);
public:
explicit BtreeOMapManager(TransactionManager &tm);
- initialize_omap_ret initialize_omap(Transaction &t, laddr_t hint) final;
+ initialize_omap_ret initialize_omap(Transaction &t, laddr_t hint,
+ omap_type_t type) final;
omap_get_value_ret omap_get_value(
const omap_root_t &omap_root,
!root.is_null() ?
tm_iertr::now() :
omap_manager.initialize_omap(
- t, onode->get_metadata_hint(device->get_block_size())
+ t, onode->get_metadata_hint(device->get_block_size()),
+ root.get_type()
).si_then([&root](auto new_root) {
root = new_root;
});