]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/lba: remove refresh_lba_mapping
authorXuehan Xu <xuxuehan@qianxin.com>
Thu, 19 Jun 2025 01:12:28 +0000 (09:12 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Thu, 31 Jul 2025 02:03:49 +0000 (10:03 +0800)
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/lba/btree_lba_manager.cc
src/crimson/os/seastore/lba/btree_lba_manager.h
src/crimson/os/seastore/lba_manager.h
src/crimson/os/seastore/transaction_manager.h
src/test/crimson/seastore/test_transaction_manager.cc

index bd809fa579889ddc11f42a685362bc28afca1dc0..56b497a57fb1ab2318b1d90a919dbe261c106a21 100644 (file)
@@ -725,38 +725,6 @@ BtreeLBAManager::get_physical_extent_if_live(
     });
 }
 
-BtreeLBAManager::refresh_lba_mapping_ret
-BtreeLBAManager::refresh_lba_mapping(Transaction &t, LBAMapping mapping)
-{
-  if (mapping.is_viewable()) {
-    return refresh_lba_mapping_iertr::make_ready_future<
-      LBAMapping>(std::move(mapping));
-  }
-  auto c = get_context(t);
-  return with_btree_state<LBABtree, LBAMapping>(
-    cache,
-    c,
-    std::move(mapping),
-    [](LBABtree &btree, LBAMapping &mapping) mutable
-  {
-    return seastar::futurize_invoke([&mapping] {
-      if (mapping.direct_cursor) {
-       return mapping.direct_cursor->refresh();
-      }
-      return base_iertr::now();
-    }).si_then([&mapping] {
-      if (mapping.indirect_cursor) {
-       return mapping.indirect_cursor->refresh();
-      }
-      return base_iertr::now();
-#ifndef NDEBUG
-    }).si_then([&mapping] {
-      assert(mapping.is_viewable());
-#endif
-    });
-  });
-}
-
 void BtreeLBAManager::register_metrics()
 {
   LOG_PREFIX(BtreeLBAManager::register_metrics);
index a3df2b304014b786667d47e625a35c117ca2b60f..1e4848f683edbd05281fe643cc986a29e6991bce 100644 (file)
@@ -265,10 +265,6 @@ public:
     laddr_t laddr,
     extent_len_t len) final;
 
-  refresh_lba_mapping_ret refresh_lba_mapping(
-    Transaction &t,
-    LBAMapping mapping) final;
-
 private:
   Cache &cache;
 
index d146a9932ece9465521915749cc00c943db89917..b01e89633d1ba7b2c88f179e238bb1194110ae9b 100644 (file)
@@ -230,12 +230,6 @@ public:
     laddr_t laddr,
     extent_len_t len) = 0;
 
-  using refresh_lba_mapping_iertr = base_iertr;
-  using refresh_lba_mapping_ret = refresh_lba_mapping_iertr::future<LBAMapping>;
-  virtual refresh_lba_mapping_ret refresh_lba_mapping(
-    Transaction &t,
-    LBAMapping mapping) = 0;
-
   virtual ~LBAManager() {}
 };
 using LBAManagerRef = std::unique_ptr<LBAManager>;
index a5788367515f002ee31c26fa8c2de3ac352cecb1..6a273e7c49c2bb8e18ce4e514e5ea7e484ac13ff 100644 (file)
@@ -277,7 +277,7 @@ public:
     SUBDEBUGT(seastore_tm, "{} {} 0x{:x}~0x{:x} direct_off=0x{:x} ...",
               t, T::TYPE, pin, partial_off, partial_len, direct_partial_off);
 
-    return lba_manager->refresh_lba_mapping(t, std::move(pin)
+    return pin.refresh(
     ).si_then([&t, this, direct_partial_off, partial_len,
               maybe_init=std::move(maybe_init)](auto npin) mutable {
       // checking the lba child must be atomic with creating
index f03ef118cda59157ddf81df62ff952e51089f0a6..e6120c4745fc2c4436e9a77ac02610a7b7bb6ff2 100644 (file)
@@ -783,8 +783,8 @@ struct transaction_manager_test_t :
   }
 
   LBAMapping refresh_lba_mapping(test_transaction_t &t, LBAMapping mapping) {
-    return with_trans_intr(*t.t, [this, mapping=std::move(mapping)](auto &t) mutable {
-      return lba_manager->refresh_lba_mapping(t, std::move(mapping));
+    return with_trans_intr(*t.t, [mapping=std::move(mapping)](auto &t) mutable {
+      return mapping.refresh();
     }).unsafe_get();
   }