]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cached_extent: duplicate_for_write accepts the transaction ref...
authorXuehan Xu <xxhdx1985126@gmail.com>
Tue, 13 Sep 2022 07:53:53 +0000 (15:53 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Sat, 6 May 2023 05:37:30 +0000 (13:37 +0800)
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
12 files changed:
src/crimson/os/seastore/btree/fixed_kv_node.h
src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/cached_extent.cc
src/crimson/os/seastore/cached_extent.h
src/crimson/os/seastore/collection_manager/collection_flat_node.h
src/crimson/os/seastore/object_data_handler.h
src/crimson/os/seastore/omap_manager/btree/omap_btree_node_impl.h
src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/dummy.h
src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/seastore.h
src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/test_replay.h
src/crimson/os/seastore/root_block.h
src/test/crimson/seastore/test_block.h

index 5658d0bf5d40f18fbdf7c5131535faaa45aa9431..75628f6fcbff7e842a7056e8c3aca5a01edf8f18 100644 (file)
@@ -109,7 +109,7 @@ struct FixedKVInternalNode
            ? &delta_buffer : nullptr;
   }
 
-  CachedExtentRef duplicate_for_write() override {
+  CachedExtentRef duplicate_for_write(Transaction&) override {
     assert(delta_buffer.empty());
     return CachedExtentRef(new node_type_t(*this));
   };
@@ -338,7 +338,7 @@ struct FixedKVLeafNode
     return this->is_mutation_pending() ? &delta_buffer : nullptr;
   }
 
-  CachedExtentRef duplicate_for_write() override {
+  CachedExtentRef duplicate_for_write(Transaction&) override {
     assert(delta_buffer.empty());
     return CachedExtentRef(new node_type_t(*this));
   };
index 65c0f8ef5fe40f3d9d96106db44c59583e9d78f7..8209e374994048bef1f3e212ce42ccde57796e60 100644 (file)
@@ -1012,7 +1012,7 @@ CachedExtentRef Cache::duplicate_for_write(
     return i;
   }
 
-  auto ret = i->duplicate_for_write();
+  auto ret = i->duplicate_for_write(t);
   ret->pending_for_transaction = t.get_trans_id();
   ret->prior_instance = i;
   // duplicate_for_write won't occur after ool write finished
index dc7b8e6165b85b9fc454323ee3e3d87f56160311..84f5f89c99b251ef5f56fb9e61323661f5175175 100644 (file)
@@ -2,6 +2,7 @@
 // vim: ts=8 sw=2 smarttab
 
 #include "crimson/os/seastore/cached_extent.h"
+#include "crimson/os/seastore/transaction.h"
 
 #include "crimson/common/log.h"
 
index 7f76c26145302dfd0bdf3508d3dfe6b1db194862..f79eb3e644ee98f8da9a7739900077c88896e33d 100644 (file)
@@ -192,7 +192,7 @@ public:
    * structure which defers updating the actual buffer until
    * on_delta_write().
    */
-  virtual CachedExtentRef duplicate_for_write() = 0;
+  virtual CachedExtentRef duplicate_for_write(Transaction &t) = 0;
 
   /**
    * prepare_write
@@ -846,7 +846,7 @@ public:
 
   extent_len_t get_length() const final { return length; }
 
-  CachedExtentRef duplicate_for_write() final {
+  CachedExtentRef duplicate_for_write(Transaction&) final {
     ceph_assert(0 == "Should never happen for a placeholder");
     return CachedExtentRef();
   }
index c35500ffd67954e27675fe4ea5a294f9ca803c1c..1652eb92f227ba3f7e3d0cd344df488638cc8eea 100644 (file)
@@ -105,7 +105,7 @@ struct CollectionNode
   coll_map_t decoded;
   delta_buffer_t delta_buffer;
 
-  CachedExtentRef duplicate_for_write() final {
+  CachedExtentRef duplicate_for_write(Transaction&) final {
     assert(delta_buffer.empty());
     return CachedExtentRef(new CollectionNode(*this));
   }
index 510dd8f1449dc2c558dc4553d8adebb4b8247397..6fd73dc762a3aa62228011eb7424f4e99f9df3fb 100644 (file)
@@ -24,7 +24,7 @@ struct ObjectDataBlock : crimson::os::seastore::LogicalCachedExtent {
   ObjectDataBlock(const ObjectDataBlock &other)
     : LogicalCachedExtent(other) {}
 
-  CachedExtentRef duplicate_for_write() final {
+  CachedExtentRef duplicate_for_write(Transaction&) final {
     return CachedExtentRef(new ObjectDataBlock(*this));
   };
 
index 574f29bea966888452c6ff5f6afe7bc4b6b51c8c..a2b51bbb0e135f04c48ea34336cce84ac121c2d1 100644 (file)
@@ -46,7 +46,7 @@ struct OMapInnerNode
   bool extent_is_below_min() const { return below_min(); }
   uint32_t get_node_size() { return get_size(); }
 
-  CachedExtentRef duplicate_for_write() final {
+  CachedExtentRef duplicate_for_write(Transaction&) final {
     assert(delta_buffer.empty());
     return CachedExtentRef(new OMapInnerNode(*this));
   }
@@ -164,7 +164,7 @@ struct OMapLeafNode
   bool extent_is_below_min() const { return below_min(); }
   uint32_t get_node_size() { return get_size(); }
 
-  CachedExtentRef duplicate_for_write() final {
+  CachedExtentRef duplicate_for_write(Transaction&) final {
     assert(delta_buffer.empty());
     return CachedExtentRef(new OMapLeafNode(*this));
   }
index e18112ab6e6eb98a7841967984c1daab8d74e67e..24df8b548e933f4723a9cc69b8c8f9c763c5e0ac 100644 (file)
@@ -55,7 +55,7 @@ class DummyNodeExtent final: public NodeExtent {
     ceph_abort("impossible path"); }
   DeltaRecorder* get_recorder() const override {
     return nullptr; }
-  CachedExtentRef duplicate_for_write() override {
+  CachedExtentRef duplicate_for_write(Transaction&) override {
     ceph_abort("impossible path"); }
   extent_types_t get_type() const override {
     return extent_types_t::TEST_BLOCK; }
index b648baacf00a4153cf3c41033a684315c3ff0e9d..f7cfa8c2112d6287cd27a5ace4cd991be848eff9 100644 (file)
@@ -59,7 +59,7 @@ class SeastoreNodeExtent final: public NodeExtent {
     return recorder.get();
   }
 
-  CachedExtentRef duplicate_for_write() override {
+  CachedExtentRef duplicate_for_write(Transaction&) override {
     return CachedExtentRef(new SeastoreNodeExtent(*this));
   }
   ceph::bufferlist get_delta() override {
index b63a362f845edeee634fd89f703302a3411c32d7..bce74e3814058dff61217a938a1cde805d265ef8 100644 (file)
@@ -47,7 +47,7 @@ class TestReplayExtent final: public NodeExtent {
     ceph_abort("impossible path"); }
   DeltaRecorder* get_recorder() const override {
     ceph_abort("impossible path"); }
-  CachedExtentRef duplicate_for_write() override {
+  CachedExtentRef duplicate_for_write(Transaction&) override {
     ceph_abort("impossible path"); }
   extent_types_t get_type() const override {
     return extent_types_t::TEST_BLOCK; }
index b686e56a464979fa332c4c4a03b195bb80fddf0d..435860ff36bb18a23dd0542ce8704c41f33d4efc 100644 (file)
@@ -42,7 +42,7 @@ struct RootBlock : CachedExtent {
 
   RootBlock(const RootBlock &rhs) = default;
 
-  CachedExtentRef duplicate_for_write() final {
+  CachedExtentRef duplicate_for_write(Transaction&) final {
     return CachedExtentRef(new RootBlock(*this));
   };
 
index 26588321d09790d98fece6c928448de071ca136a..ccdafb7843fecd0b7f79d98947e551ea3f2623c2 100644 (file)
@@ -54,7 +54,7 @@ struct TestBlock : crimson::os::seastore::LogicalCachedExtent {
   TestBlock(const TestBlock &other)
     : LogicalCachedExtent(other) {}
 
-  CachedExtentRef duplicate_for_write() final {
+  CachedExtentRef duplicate_for_write(Transaction&) final {
     return CachedExtentRef(new TestBlock(*this));
   };
 
@@ -93,7 +93,7 @@ struct TestBlockPhysical : crimson::os::seastore::CachedExtent{
   TestBlockPhysical(const TestBlockPhysical &other)
     : CachedExtent(other) {}
 
-  CachedExtentRef duplicate_for_write() final {
+  CachedExtentRef duplicate_for_write(Transaction&) final {
     return CachedExtentRef(new TestBlockPhysical(*this));
   };