]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cached_extent: add prepare_commit interface 51948/head
authorXuehan Xu <xuxuehan@qianxin.com>
Wed, 7 Jun 2023 01:55:38 +0000 (09:55 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Wed, 7 Jun 2023 01:55:38 +0000 (09:55 +0800)
move new fixedkv-btree nodes' inter-node pointer adjustments into
the prepare_commit interface

Fixes: https://tracker.ceph.com/issues/61608
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/btree/fixed_kv_node.h
src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/cached_extent.h

index fe5052824dc8e742a744f0318590c14a7cc09a75..956a1824e2a50967d2990d35a767cbcc2e7450be 100644 (file)
@@ -564,7 +564,7 @@ struct FixedKVInternalNode
     return this->get_split_pivot().get_offset();
   }
 
-  void prepare_write() final {
+  void prepare_commit() final {
     if (this->is_initial_pending()) {
       if (this->is_rewrite()) {
        this->set_children_from_prior_instance();
@@ -1004,7 +1004,7 @@ struct FixedKVLeafNode
     }
   }
 
-  void prepare_write() final {
+  void prepare_commit() final {
     if constexpr (has_children) {
       if (this->is_initial_pending()) {
        if (this->is_rewrite()) {
index d6c9fdce3aa6381cedecacca5390bd9c3908face..7e7012226d4c12e54930f7ecdc2f29a3efd39c41 100644 (file)
@@ -1098,6 +1098,7 @@ record_t Cache::prepare_record(
 
     i->prepare_write();
     i->set_io_wait();
+    i->prepare_commit();
 
     assert(i->get_version() > 0);
     auto final_crc = i->get_crc32c();
@@ -1200,6 +1201,7 @@ record_t Cache::prepare_record(
 
     bufferlist bl;
     i->prepare_write();
+    i->prepare_commit();
     bl.append(i->get_bptr());
     if (i->get_type() == extent_types_t::ROOT) {
       ceph_assert(0 == "ROOT never gets written as a fresh block");
@@ -1240,6 +1242,7 @@ record_t Cache::prepare_record(
     assert(!i->is_inline());
     get_by_ext(efforts.fresh_ool_by_ext,
                i->get_type()).increment(i->get_length());
+    i->prepare_commit();
     if (is_backref_mapped_extent_node(i)) {
       alloc_delta.alloc_blk_ranges.emplace_back(
        i->get_paddr(),
index 464f34d79fdc7801dd69bfbc75f35f027d85665d..871ad8f08e15e6b9849b2a38e9c04bf05e54969e 100644 (file)
@@ -250,6 +250,14 @@ public:
    */
   virtual void prepare_write() {}
 
+  /**
+   * prepare_commit
+   *
+   * Called prior to committing the transaction in which this extent
+   * is living.
+   */
+  virtual void prepare_commit() {}
+
   /**
    * on_initial_write
    *