Skip to content

Commit b170414

Browse files
committed
crimson/os/seastore/cached_extent: drop the unused retired_at
Signed-off-by: Yingxin Cheng <[email protected]>
1 parent 188739f commit b170414

File tree

2 files changed

+13
-24
lines changed

2 files changed

+13
-24
lines changed

src/crimson/os/seastore/cache.cc

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ void Cache::commit_retire_extent(
889889
const auto t_src = t.get_src();
890890
remove_extent(ref, &t_src);
891891

892-
ref->dirty_from_or_retired_at = JOURNAL_SEQ_NULL;
892+
ref->dirty_from = JOURNAL_SEQ_NULL;
893893
invalidate_extent(t, *ref);
894894
}
895895

@@ -1286,7 +1286,7 @@ record_t Cache::prepare_record(
12861286
if (i->prior_instance->version == 0 && i->version > 1) {
12871287
assert(can_inplace_rewrite(i->get_type()));
12881288
assert(can_inplace_rewrite(i->prior_instance->get_type()));
1289-
assert(i->prior_instance->dirty_from_or_retired_at == JOURNAL_SEQ_MIN);
1289+
assert(i->prior_instance->dirty_from == JOURNAL_SEQ_MIN);
12901290
assert(i->prior_instance->state == CachedExtent::extent_state_t::CLEAN);
12911291
assert(i->prior_instance->get_paddr().is_absolute_random_block());
12921292
i->version = 1;
@@ -1517,7 +1517,7 @@ record_t Cache::prepare_record(
15171517
// set the version to zero because the extent state is now clean
15181518
// in order to handle this transparently
15191519
i->version = 0;
1520-
i->dirty_from_or_retired_at = JOURNAL_SEQ_MIN;
1520+
i->dirty_from = JOURNAL_SEQ_MIN;
15211521
i->state = CachedExtent::extent_state_t::CLEAN;
15221522
assert(i->is_logical());
15231523
i->clear_modified_region();
@@ -1846,7 +1846,7 @@ void Cache::complete_commit(
18461846
i->state = CachedExtent::extent_state_t::DIRTY;
18471847
assert(i->version > 0);
18481848
if (i->version == 1 || is_root_type(i->get_type())) {
1849-
i->dirty_from_or_retired_at = start_seq;
1849+
i->dirty_from = start_seq;
18501850
DEBUGT("commit extent done, become dirty -- {}", t, *i);
18511851
} else {
18521852
DEBUGT("commit extent done -- {}", t, *i);
@@ -1872,10 +1872,6 @@ void Cache::complete_commit(
18721872
}
18731873

18741874
last_commit = start_seq;
1875-
for (auto &i: t.retired_set) {
1876-
auto &extent = i.extent;
1877-
extent->dirty_from_or_retired_at = start_seq;
1878-
}
18791875

18801876
apply_backref_byseq(t.move_backref_entries(), start_seq);
18811877
commit_backref_entries(std::move(backref_entries), start_seq);
@@ -2034,7 +2030,7 @@ Cache::replay_delta(
20342030
ceph_assert(delta.paddr.is_root());
20352031
remove_extent(root, nullptr);
20362032
root->apply_delta_and_adjust_crc(record_base, delta.bl);
2037-
root->dirty_from_or_retired_at = journal_seq;
2033+
root->dirty_from = journal_seq;
20382034
root->state = CachedExtent::extent_state_t::DIRTY;
20392035
root->version = 1; // shouldn't be 0 as a dirty extent
20402036
DEBUG("replayed root delta at {} {}, add extent -- {}, root={}",
@@ -2110,7 +2106,7 @@ Cache::replay_delta(
21102106

21112107
extent->version++;
21122108
if (extent->version == 1) {
2113-
extent->dirty_from_or_retired_at = journal_seq;
2109+
extent->dirty_from = journal_seq;
21142110
DEBUG("replayed extent delta at {} {}, become dirty -- {}, extent={}" ,
21152111
journal_seq, record_base, delta, *extent);
21162112
} else {

src/crimson/os/seastore/cached_extent.h

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ class CachedExtent
467467
<< ", trans=" << pending_for_transaction
468468
<< ", pending_io=" << is_pending_io()
469469
<< ", version=" << version
470-
<< ", dirty_from_or_retired_at=" << dirty_from_or_retired_at
470+
<< ", dirty_from=" << dirty_from
471471
<< ", modify_time=" << sea_time_point_printer_t{modify_time}
472472
<< ", paddr=" << get_paddr()
473473
<< ", prior_paddr=" << prior_poffset_str
@@ -648,13 +648,7 @@ class CachedExtent
648648
/// Return journal location of oldest relevant delta, only valid while DIRTY
649649
auto get_dirty_from() const {
650650
ceph_assert(has_delta());
651-
return dirty_from_or_retired_at;
652-
}
653-
654-
/// Return journal location of oldest relevant delta, only valid while RETIRED
655-
auto get_retired_at() const {
656-
ceph_assert(!is_valid());
657-
return dirty_from_or_retired_at;
651+
return dirty_from;
658652
}
659653

660654
/// Return true if extent is fully loaded or is about to be fully loaded (call
@@ -862,12 +856,11 @@ class CachedExtent
862856
primary_ref_list_member_options>;
863857

864858
/**
865-
* dirty_from_or_retired_at
859+
* dirty_from
866860
*
867-
* Encodes ordering token for primary_ref_list -- dirty_from when
868-
* dirty or retired_at if retired.
861+
* Encodes ordering token for primary_ref_list -- dirty_from when dirty
869862
*/
870-
journal_seq_t dirty_from_or_retired_at;
863+
journal_seq_t dirty_from;
871864

872865
/// cache data contents, std::nullopt iff partially loaded
873866
std::optional<ceph::bufferptr> ptr;
@@ -957,7 +950,7 @@ class CachedExtent
957950
/// construct new CachedExtent, will deep copy the buffer
958951
CachedExtent(const CachedExtent &other)
959952
: state(other.state),
960-
dirty_from_or_retired_at(other.dirty_from_or_retired_at),
953+
dirty_from(other.dirty_from),
961954
length(other.get_length()),
962955
loaded_length(other.get_loaded_length()),
963956
version(other.version),
@@ -979,7 +972,7 @@ class CachedExtent
979972
/// construct new CachedExtent, will shallow copy the buffer
980973
CachedExtent(const CachedExtent &other, share_buffer_t)
981974
: state(other.state),
982-
dirty_from_or_retired_at(other.dirty_from_or_retired_at),
975+
dirty_from(other.dirty_from),
983976
ptr(other.ptr),
984977
length(other.get_length()),
985978
loaded_length(other.get_loaded_length()),

0 commit comments

Comments
 (0)