From: Yingxin Cheng Date: Fri, 25 Apr 2025 08:32:07 +0000 (+0800) Subject: crimson/os/seastore/cached_extent: drop the unused retired_at X-Git-Tag: v21.0.0~256^2~546^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b1704147f81ed4626990b843c14e18f5cd1bc135;p=ceph.git crimson/os/seastore/cached_extent: drop the unused retired_at Signed-off-by: Yingxin Cheng --- diff --git a/src/crimson/os/seastore/cache.cc b/src/crimson/os/seastore/cache.cc index 62bb281aae90..8a373791c9cf 100644 --- a/src/crimson/os/seastore/cache.cc +++ b/src/crimson/os/seastore/cache.cc @@ -889,7 +889,7 @@ void Cache::commit_retire_extent( const auto t_src = t.get_src(); remove_extent(ref, &t_src); - ref->dirty_from_or_retired_at = JOURNAL_SEQ_NULL; + ref->dirty_from = JOURNAL_SEQ_NULL; invalidate_extent(t, *ref); } @@ -1286,7 +1286,7 @@ record_t Cache::prepare_record( if (i->prior_instance->version == 0 && i->version > 1) { assert(can_inplace_rewrite(i->get_type())); assert(can_inplace_rewrite(i->prior_instance->get_type())); - assert(i->prior_instance->dirty_from_or_retired_at == JOURNAL_SEQ_MIN); + assert(i->prior_instance->dirty_from == JOURNAL_SEQ_MIN); assert(i->prior_instance->state == CachedExtent::extent_state_t::CLEAN); assert(i->prior_instance->get_paddr().is_absolute_random_block()); i->version = 1; @@ -1517,7 +1517,7 @@ record_t Cache::prepare_record( // set the version to zero because the extent state is now clean // in order to handle this transparently i->version = 0; - i->dirty_from_or_retired_at = JOURNAL_SEQ_MIN; + i->dirty_from = JOURNAL_SEQ_MIN; i->state = CachedExtent::extent_state_t::CLEAN; assert(i->is_logical()); i->clear_modified_region(); @@ -1846,7 +1846,7 @@ void Cache::complete_commit( i->state = CachedExtent::extent_state_t::DIRTY; assert(i->version > 0); if (i->version == 1 || is_root_type(i->get_type())) { - i->dirty_from_or_retired_at = start_seq; + i->dirty_from = start_seq; DEBUGT("commit extent done, become dirty -- {}", t, *i); } else { DEBUGT("commit extent done -- {}", t, *i); @@ -1872,10 +1872,6 @@ void Cache::complete_commit( } last_commit = start_seq; - for (auto &i: t.retired_set) { - auto &extent = i.extent; - extent->dirty_from_or_retired_at = start_seq; - } apply_backref_byseq(t.move_backref_entries(), start_seq); commit_backref_entries(std::move(backref_entries), start_seq); @@ -2034,7 +2030,7 @@ Cache::replay_delta( ceph_assert(delta.paddr.is_root()); remove_extent(root, nullptr); root->apply_delta_and_adjust_crc(record_base, delta.bl); - root->dirty_from_or_retired_at = journal_seq; + root->dirty_from = journal_seq; root->state = CachedExtent::extent_state_t::DIRTY; root->version = 1; // shouldn't be 0 as a dirty extent DEBUG("replayed root delta at {} {}, add extent -- {}, root={}", @@ -2110,7 +2106,7 @@ Cache::replay_delta( extent->version++; if (extent->version == 1) { - extent->dirty_from_or_retired_at = journal_seq; + extent->dirty_from = journal_seq; DEBUG("replayed extent delta at {} {}, become dirty -- {}, extent={}" , journal_seq, record_base, delta, *extent); } else { diff --git a/src/crimson/os/seastore/cached_extent.h b/src/crimson/os/seastore/cached_extent.h index 8ba353976dba..747952333128 100644 --- a/src/crimson/os/seastore/cached_extent.h +++ b/src/crimson/os/seastore/cached_extent.h @@ -467,7 +467,7 @@ public: << ", trans=" << pending_for_transaction << ", pending_io=" << is_pending_io() << ", version=" << version - << ", dirty_from_or_retired_at=" << dirty_from_or_retired_at + << ", dirty_from=" << dirty_from << ", modify_time=" << sea_time_point_printer_t{modify_time} << ", paddr=" << get_paddr() << ", prior_paddr=" << prior_poffset_str @@ -648,13 +648,7 @@ public: /// Return journal location of oldest relevant delta, only valid while DIRTY auto get_dirty_from() const { ceph_assert(has_delta()); - return dirty_from_or_retired_at; - } - - /// Return journal location of oldest relevant delta, only valid while RETIRED - auto get_retired_at() const { - ceph_assert(!is_valid()); - return dirty_from_or_retired_at; + return dirty_from; } /// Return true if extent is fully loaded or is about to be fully loaded (call @@ -862,12 +856,11 @@ private: primary_ref_list_member_options>; /** - * dirty_from_or_retired_at + * dirty_from * - * Encodes ordering token for primary_ref_list -- dirty_from when - * dirty or retired_at if retired. + * Encodes ordering token for primary_ref_list -- dirty_from when dirty */ - journal_seq_t dirty_from_or_retired_at; + journal_seq_t dirty_from; /// cache data contents, std::nullopt iff partially loaded std::optional ptr; @@ -957,7 +950,7 @@ protected: /// construct new CachedExtent, will deep copy the buffer CachedExtent(const CachedExtent &other) : state(other.state), - dirty_from_or_retired_at(other.dirty_from_or_retired_at), + dirty_from(other.dirty_from), length(other.get_length()), loaded_length(other.get_loaded_length()), version(other.version), @@ -979,7 +972,7 @@ protected: /// construct new CachedExtent, will shallow copy the buffer CachedExtent(const CachedExtent &other, share_buffer_t) : state(other.state), - dirty_from_or_retired_at(other.dirty_from_or_retired_at), + dirty_from(other.dirty_from), ptr(other.ptr), length(other.get_length()), loaded_length(other.get_loaded_length()),