]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: initialize omap tree using omap type
authorMyoungwon Oh <ohmyoungwon@gmail.com>
Mon, 25 Nov 2024 12:22:50 +0000 (12:22 +0000)
committermyoungwon oh <ohmyoungwon@gmail.com>
Thu, 20 Feb 2025 12:27:36 +0000 (12:27 +0000)
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
src/crimson/os/seastore/omap_manager.h
src/crimson/os/seastore/omap_manager/btree/btree_omap_manager.cc
src/crimson/os/seastore/omap_manager/btree/btree_omap_manager.h
src/crimson/os/seastore/seastore.cc

index f558f5edc3e66ded4b1c6ba936b3f8d3f7b1ec91..e398b18d1fc30caa5c347b9ead25cf1b56f2bced 100644 (file)
@@ -40,7 +40,8 @@ public:
    */
   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)
index 3189c2bc6334170f41a18bea0e4bf73e947e2ecb..1e4afffaf7bcd64e0c30c5616741e6cf2d16e86f 100644 (file)
@@ -18,17 +18,18 @@ BtreeOMapManager::BtreeOMapManager(
   : 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);
index 7fcba64c033470087cc946a8390327191d77309e..db6ba5ea531208b95c14d09afde55f85fb8e6270 100644 (file)
@@ -65,7 +65,8 @@ class BtreeOMapManager : public OMapManager {
 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,
index 6a866cb1f9bedd3734b309e70d2298c2e31f61f3..cd9536b9568a6ec94d484b7ea97d1170fe8d07e1 100644 (file)
@@ -2262,7 +2262,8 @@ SeaStore::Shard::_omap_set_kvs(
         !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;
         });