From: Myoungwon Oh Date: Mon, 25 Nov 2024 09:22:15 +0000 (+0000) Subject: crimson/os/seastore: introduce two omap types (small and large) to omap_root_t X-Git-Tag: v20.0.0~24^2~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6fae0fdf38367bdf14bccc82b092e9d967cd98e4;p=ceph.git crimson/os/seastore: introduce two omap types (small and large) to omap_root_t Signed-off-by: Myoungwon Oh --- diff --git a/src/crimson/os/seastore/omap_manager/btree/btree_omap_manager.cc b/src/crimson/os/seastore/omap_manager/btree/btree_omap_manager.cc index 046cc286208..3189c2bc633 100644 --- a/src/crimson/os/seastore/omap_manager/btree/btree_omap_manager.cc +++ b/src/crimson/os/seastore/omap_manager/btree/btree_omap_manager.cc @@ -64,7 +64,8 @@ BtreeOMapManager::handle_root_split( "", nroot->maybe_get_delta_buffer()); nroot->journal_inner_insert(nroot->iter_begin() + 1, right->get_laddr(), pivot, nroot->maybe_get_delta_buffer()); - omap_root.update(nroot->get_laddr(), omap_root.get_depth() + 1, omap_root.hint); + omap_root.update(nroot->get_laddr(), omap_root.get_depth() + 1, omap_root.hint, + omap_root.get_type()); oc.t.get_omap_tree_stats().depth = omap_root.depth; ++(oc.t.get_omap_tree_stats().extents_num_delta); return seastar::now(); @@ -87,7 +88,8 @@ BtreeOMapManager::handle_root_merge( omap_root.update( iter->get_val(), omap_root.depth -= 1, - omap_root.hint); + omap_root.hint, + omap_root.get_type()); oc.t.get_omap_tree_stats().depth = omap_root.depth; oc.t.get_omap_tree_stats().extents_num_delta--; return oc.tm.remove(oc.t, root->get_laddr() @@ -285,7 +287,7 @@ BtreeOMapManager::omap_clear( ).si_then([&omap_root] (auto ret) { omap_root.update( L_ADDR_NULL, - 0, L_ADDR_MIN); + 0, L_ADDR_MIN, omap_root.get_type()); return omap_clear_iertr::now(); }); }).handle_error_interruptible( diff --git a/src/crimson/os/seastore/seastore.h b/src/crimson/os/seastore/seastore.h index e2a993b9e20..39a556ac4ea 100644 --- a/src/crimson/os/seastore/seastore.h +++ b/src/crimson/os/seastore/seastore.h @@ -433,11 +433,6 @@ public: uint64_t offset, size_t len, ceph::bufferlist &&bl, uint32_t fadvise_flags); - enum class omap_type_t : uint8_t { - XATTR = 0, - OMAP, - NUM_TYPES - }; tm_ret _clone_omaps( internal_context_t &ctx, OnodeRef &onode, diff --git a/src/crimson/os/seastore/seastore_types.h b/src/crimson/os/seastore/seastore_types.h index 5930469ca07..fceca0c997c 100644 --- a/src/crimson/os/seastore/seastore_types.h +++ b/src/crimson/os/seastore/seastore_types.h @@ -1789,17 +1789,26 @@ struct __attribute__((packed)) object_data_le_t { } }; +enum class omap_type_t : uint8_t { + XATTR = 0, + OMAP, + LOG, + NUM_TYPES +}; + struct omap_root_t { laddr_t addr = L_ADDR_NULL; depth_t depth = 0; laddr_t hint = L_ADDR_MIN; bool mutated = false; + omap_type_t type = omap_type_t::NUM_TYPES; omap_root_t() = default; - omap_root_t(laddr_t addr, depth_t depth, laddr_t addr_min) + omap_root_t(laddr_t addr, depth_t depth, laddr_t addr_min, omap_type_t type) : addr(addr), depth(depth), - hint(addr_min) {} + hint(addr_min), + type(type) {} omap_root_t(const omap_root_t &o) = default; omap_root_t(omap_root_t &&o) = default; @@ -1814,11 +1823,12 @@ struct omap_root_t { return mutated; } - void update(laddr_t _addr, depth_t _depth, laddr_t _hint) { + void update(laddr_t _addr, depth_t _depth, laddr_t _hint, omap_type_t _type) { mutated = true; addr = _addr; depth = _depth; hint = _hint; + type = _type; } laddr_t get_location() const { @@ -1832,18 +1842,25 @@ struct omap_root_t { laddr_t get_hint() const { return hint; } + + omap_type_t get_type() const { + return type; + } }; std::ostream &operator<<(std::ostream &out, const omap_root_t &root); class __attribute__((packed)) omap_root_le_t { laddr_le_t addr = laddr_le_t(L_ADDR_NULL); depth_le_t depth = init_depth_le(0); + omap_type_t type = omap_type_t::NUM_TYPES; public: omap_root_le_t() = default; - omap_root_le_t(laddr_t addr, depth_t depth) - : addr(addr), depth(init_depth_le(depth)) {} + omap_root_le_t(laddr_t addr, depth_t depth, omap_type_t type) + : addr(addr), depth(init_depth_le(depth)), type(type) {} + + omap_root_le_t(omap_type_t type) : type(type) {} omap_root_le_t(const omap_root_le_t &o) = default; omap_root_le_t(omap_root_le_t &&o) = default; @@ -1853,10 +1870,11 @@ public: void update(const omap_root_t &nroot) { addr = nroot.get_location(); depth = init_depth_le(nroot.get_depth()); + type = nroot.get_type(); } omap_root_t get(laddr_t hint) const { - return omap_root_t(addr, depth, hint); + return omap_root_t(addr, depth, hint, type); } };