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: v18.1.0~82^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bd5b1bb6b0db45556debf3ba103273565af15b41;p=ceph.git crimson/os/seastore/cache: consider EXIST_CLEAN extents as pending ones Signed-off-by: Xuehan Xu (cherry picked from commit f34faf363e69053d18d50263ee02ca5948b6462c) --- diff --git a/src/crimson/os/seastore/cache.cc b/src/crimson/os/seastore/cache.cc index 97b60eb4006..243d1dffd03 100644 --- a/src/crimson/os/seastore/cache.cc +++ b/src/crimson/os/seastore/cache.cc @@ -995,7 +995,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 29cfd687ae3..e4c3ec50f13 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;