From a6cac66baa718090fb9b9b24f9fa3bff20ba585c Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Mon, 22 Jul 2024 10:33:47 +0800 Subject: [PATCH] crimson/os/seastore/transaction: rename ool_block_lists Drop the inaccurate written_ prefix because they may be still writting when added to the lists. Signed-off-by: Yingxin Cheng --- src/crimson/os/seastore/cache.cc | 10 +++++----- src/crimson/os/seastore/transaction.h | 27 +++++++++++++++------------ 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/crimson/os/seastore/cache.cc b/src/crimson/os/seastore/cache.cc index 74688d8db22..fcc3507f9d9 100644 --- a/src/crimson/os/seastore/cache.cc +++ b/src/crimson/os/seastore/cache.cc @@ -1322,7 +1322,7 @@ record_t Cache::prepare_record( } } - for (auto &i: t.written_ool_block_list) { + for (auto &i: t.ool_block_list) { TRACET("fresh ool extent -- {}", t, *i); ceph_assert(i->is_valid()); assert(!i->is_inline()); @@ -1340,7 +1340,7 @@ record_t Cache::prepare_record( } } - for (auto &i: t.written_inplace_ool_block_list) { + for (auto &i: t.inplace_ool_block_list) { if (!i->is_valid()) { continue; } @@ -1422,13 +1422,13 @@ record_t Cache::prepare_record( ceph_assert(t.get_fresh_block_stats().num == t.inline_block_list.size() + - t.written_ool_block_list.size() + + t.ool_block_list.size() + t.num_delayed_invalid_extents + t.num_allocated_invalid_extents); auto& ool_stats = t.get_ool_write_stats(); - ceph_assert(ool_stats.extents.num == t.written_ool_block_list.size() + - t.written_inplace_ool_block_list.size()); + ceph_assert(ool_stats.extents.num == t.ool_block_list.size() + + t.inplace_ool_block_list.size()); if (record.is_empty()) { SUBINFOT(seastore_t, diff --git a/src/crimson/os/seastore/transaction.h b/src/crimson/os/seastore/transaction.h index d7cdb30098a..ed9e93e02fb 100644 --- a/src/crimson/os/seastore/transaction.h +++ b/src/crimson/os/seastore/transaction.h @@ -198,7 +198,7 @@ public: } void mark_delayed_extent_ool(CachedExtentRef& ref) { - written_ool_block_list.push_back(ref); + ool_block_list.push_back(ref); } void update_delayed_ool_extent_addr(LogicalCachedExtentRef& ref, @@ -214,13 +214,13 @@ public: void mark_allocated_extent_ool(CachedExtentRef& ref) { assert(ref->get_paddr().is_absolute()); assert(!ref->is_inline()); - written_ool_block_list.push_back(ref); + ool_block_list.push_back(ref); } void mark_inplace_rewrite_extent_ool(LogicalCachedExtentRef ref) { assert(ref->get_paddr().is_absolute()); assert(!ref->is_inline()); - written_inplace_ool_block_list.push_back(ref); + inplace_ool_block_list.push_back(ref); } void add_inplace_rewrite_extent(CachedExtentRef ref) { @@ -332,7 +332,7 @@ public: template auto for_each_finalized_fresh_block(F &&f) const { - std::for_each(written_ool_block_list.begin(), written_ool_block_list.end(), f); + std::for_each(ool_block_list.begin(), ool_block_list.end(), f); std::for_each(inline_block_list.begin(), inline_block_list.end(), f); } @@ -410,8 +410,8 @@ public: num_allocated_invalid_extents = 0; delayed_alloc_list.clear(); inline_block_list.clear(); - written_ool_block_list.clear(); - written_inplace_ool_block_list.clear(); + ool_block_list.clear(); + inplace_ool_block_list.clear(); pre_alloc_list.clear(); pre_inplace_rewrite_list.clear(); retired_set.clear(); @@ -555,7 +555,7 @@ private: * Contains a reference (without a refcount) to every extent mutated * as part of *this. No contained extent may be referenced outside * of *this. Every contained extent will be in one of inline_block_list, - * written_ool_block_list or/and pre_alloc_list, mutated_block_list, + * ool_block_list or/and pre_alloc_list, mutated_block_list, * or delayed_alloc_list. */ ExtentIndex write_set; @@ -566,20 +566,23 @@ private: io_stat_t fresh_block_stats; uint64_t num_delayed_invalid_extents = 0; uint64_t num_allocated_invalid_extents = 0; - /// fresh blocks with delayed allocation, may become inline or ool below + /// fresh blocks with delayed allocation, + /// may become inline_block_list or ool_block_list below std::list delayed_alloc_list; /// fresh blocks with pre-allocated addresses with RBM, - /// should be released upon conflicts, will be added to ool below + /// should be released upon conflicts, + /// will be added to ool_block_list below std::list pre_alloc_list; - /// dirty blocks for inplace rewrite with RBM, will be added to inplace ool below + /// dirty blocks for inplace rewrite with RBM, + /// will be added to inplace inplace_ool_block_list below std::list pre_inplace_rewrite_list; /// fresh blocks that will be committed with inline journal record std::list inline_block_list; /// fresh blocks that will be committed with out-of-line record - std::list written_ool_block_list; + std::list ool_block_list; /// dirty blocks that will be committed out-of-line with inplace rewrite - std::list written_inplace_ool_block_list; + std::list inplace_ool_block_list; /// list of mutated blocks, holds refcounts, subset of write_set std::list mutated_block_list; -- 2.39.5