crimson/os/seastore/cache: consider EXIST_CLEAN extents as pending ones

Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
This commit is contained in:
Xuehan Xu 2023-03-24 18:43:57 +08:00
parent b5d6ca7a8f
commit f34faf363e
2 changed files with 7 additions and 3 deletions

View File

@ -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()) {

View File

@ -280,13 +280,17 @@ public:
return TCachedExtentRef<const T>(static_cast<const T*>(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;