From: Xuehan Xu Date: Tue, 16 Aug 2022 08:48:28 +0000 (+0800) Subject: crimson/os/seastore/cached_extent: add on_replace_prior interface X-Git-Tag: v18.1.0~34^2~18 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8468059883528e20ddb9399b708c18de98611147;p=ceph-ci.git crimson/os/seastore/cached_extent: add on_replace_prior interface Signed-off-by: Xuehan Xu (cherry picked from commit c56af30a9c199b4a5d2cba9d2208b8c1d8a6abfb) --- diff --git a/src/crimson/os/seastore/cache.cc b/src/crimson/os/seastore/cache.cc index 8209e374994..ebeb123cf5e 100644 --- a/src/crimson/os/seastore/cache.cc +++ b/src/crimson/os/seastore/cache.cc @@ -802,6 +802,7 @@ void Cache::commit_replace_extent( add_to_dirty(next); } + next->on_replace_prior(t); invalidate_extent(t, *prev); } diff --git a/src/crimson/os/seastore/cached_extent.h b/src/crimson/os/seastore/cached_extent.h index f79eb3e644e..02450449551 100644 --- a/src/crimson/os/seastore/cached_extent.h +++ b/src/crimson/os/seastore/cached_extent.h @@ -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 *