]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cached_extent: add on_replace_prior interface
authorXuehan Xu <xxhdx1985126@gmail.com>
Tue, 16 Aug 2022 08:48:28 +0000 (16:48 +0800)
committerMatan Breizman <mbreizma@redhat.com>
Tue, 23 May 2023 13:24:44 +0000 (13:24 +0000)
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
(cherry picked from commit c56af30a9c199b4a5d2cba9d2208b8c1d8a6abfb)

src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/cached_extent.h

index 8209e374994048bef1f3e212ce42ccde57796e60..ebeb123cf5e43d370f322a9c99af97d0195ac83b 100644 (file)
@@ -802,6 +802,7 @@ void Cache::commit_replace_extent(
     add_to_dirty(next);
   }
 
+  next->on_replace_prior(t);
   invalidate_extent(t, *prev);
 }
 
index f79eb3e644ee98f8da9a7739900077c88896e33d..0245044955139b2bb23c9133d510f419c025837a 100644 (file)
@@ -232,6 +232,16 @@ public:
    */
   virtual void on_delta_write(paddr_t record_block_offset) {}
 
+  /**
+   * on_replace_prior
+   *
+   * Called after the extent has replaced a previous one. State
+   * of the extent must be MUTATION_PENDING. Implementation
+   * may use this call to synchronize states that must be synchronized
+   * with the states of Cache and can't wait till transaction
+   * completes.
+   */
+  virtual void on_replace_prior(Transaction &t) {}
   /**
    * get_type
    *