]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cached_extent: drop the unused retired_at
authorYingxin Cheng <yingxin.cheng@intel.com>
Fri, 25 Apr 2025 08:32:07 +0000 (16:32 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Wed, 4 Jun 2025 02:17:52 +0000 (10:17 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/cached_extent.h

index 62bb281aae9021083109d8e3aff77c65735da08c..8a373791c9cf605419956b4908b1399639ef64fe 100644 (file)
@@ -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 {
index 8ba353976dba39f36e0ee1af553787534ae99fe0..747952333128a2347a0cb29ccf4cca70f260fe98 100644 (file)
@@ -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<ceph::bufferptr> 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()),