]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: introduce two omap types (small and large) to omap_root_t
authorMyoungwon Oh <ohmyoungwon@gmail.com>
Mon, 25 Nov 2024 09:22:15 +0000 (09:22 +0000)
committermyoungwon oh <ohmyoungwon@gmail.com>
Thu, 20 Feb 2025 12:27:21 +0000 (12:27 +0000)
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
src/crimson/os/seastore/omap_manager/btree/btree_omap_manager.cc
src/crimson/os/seastore/seastore.h
src/crimson/os/seastore/seastore_types.h

index 046cc286208b2286a0489c613639293077f5ccf5..3189c2bc6334170f41a18bea0e4bf73e947e2ecb 100644 (file)
@@ -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(
index e2a993b9e203b7fe2d27dd6f74165423d62fa3f0..39a556ac4eaf0e99f23d4dd16de89bfccd54e23e 100644 (file)
@@ -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,
index 5930469ca07ecceab67d8ded318a82fed6d737e3..fceca0c997cdcf3bd9042e21d072d024f76cdcda 100644 (file)
@@ -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);
   }
 };