From: Xuehan Xu Date: Fri, 24 Mar 2023 10:43:57 +0000 (+0800) Subject: crimson/os/seastore/cache: consider EXIST_CLEAN extents as pending ones X-Git-Tag: v19.0.0~1504^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f34faf363e69053d18d50263ee02ca5948b6462c;p=ceph.git crimson/os/seastore/cache: consider EXIST_CLEAN extents as pending ones Signed-off-by: Xuehan Xu --- diff --git a/src/crimson/os/seastore/cache.cc b/src/crimson/os/seastore/cache.cc index 86e307246f3b..86c3730fd8b4 100644 --- a/src/crimson/os/seastore/cache.cc +++ b/src/crimson/os/seastore/cache.cc @@ -999,7 +999,7 @@ CachedExtentRef Cache::duplicate_for_write( Transaction &t, CachedExtentRef i) { LOG_PREFIX(Cache::duplicate_for_write); - if (i->is_pending()) + if (i->is_mutable()) return i; if (i->is_exist_clean()) { diff --git a/src/crimson/os/seastore/cached_extent.h b/src/crimson/os/seastore/cached_extent.h index 29cfd687ae34..e4c3ec50f13f 100644 --- a/src/crimson/os/seastore/cached_extent.h +++ b/src/crimson/os/seastore/cached_extent.h @@ -280,13 +280,17 @@ public: return TCachedExtentRef(static_cast(this)); } - /// Returns true if extent is part of an open transaction - bool is_pending() const { + bool is_mutable() const { return state == extent_state_t::INITIAL_WRITE_PENDING || state == extent_state_t::MUTATION_PENDING || state == extent_state_t::EXIST_MUTATION_PENDING; } + /// Returns true if extent is part of an open transaction + bool is_pending() const { + return is_mutable() || state == extent_state_t::EXIST_CLEAN; + } + /// Returns true if extent has a pending delta bool is_mutation_pending() const { return state == extent_state_t::MUTATION_PENDING;