From 1c33a2aaf569cd7ed7e41acd8cb0af847be0de75 Mon Sep 17 00:00:00 2001 From: myoungwon oh Date: Tue, 9 Aug 2022 17:05:39 +0900 Subject: [PATCH] crimson/os/seastore/cbjournal: rename journal_tail to dirty_tail Signed-off-by: Myoungwon Oh --- .../journal/circular_bounded_journal.cc | 14 ++++++------- .../journal/circular_bounded_journal.h | 20 +++++++++---------- src/test/crimson/seastore/test_cbjournal.cc | 4 ++-- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/crimson/os/seastore/journal/circular_bounded_journal.cc b/src/crimson/os/seastore/journal/circular_bounded_journal.cc index b8adef9bd4d4f..d7a5a11febd02 100644 --- a/src/crimson/os/seastore/journal/circular_bounded_journal.cc +++ b/src/crimson/os/seastore/journal/circular_bounded_journal.cc @@ -20,7 +20,7 @@ std::ostream &operator<<(std::ostream &out, << ", uuid=" << header.uuid << ", block_size=" << header.block_size << ", size=" << header.size - << ", journal_tail=" << header.journal_tail + << ", dirty_tail=" << header.dirty_tail << ", "<< device_id_printer_t{header.device_id} << ")"; } @@ -42,16 +42,16 @@ CircularBoundedJournal::mkfs(const mkfs_config_t& config) CircularBoundedJournal::cbj_header_t head; head.block_size = config.block_size; head.size = config.total_size - device->get_block_size(); - head.journal_tail = + head.dirty_tail = journal_seq_t{0, convert_abs_addr_to_paddr( device->get_block_size(), config.device_id)}; - head.alloc_tail = head.journal_tail; + head.alloc_tail = head.dirty_tail; head.device_id = config.device_id; encode(head, bl); header = head; - set_written_to(head.journal_tail); + set_written_to(head.dirty_tail); initialized = true; DEBUG( "initialize header block in CircularBoundedJournal, length {}", @@ -273,8 +273,8 @@ Journal::replay_ret CircularBoundedJournal::replay( DEBUG("header : {}", header); initialized = true; written_to.segment_seq = NULL_SEG_SEQ; - auto tail = get_journal_tail() <= get_alloc_tail() ? - get_journal_tail() : get_alloc_tail(); + auto tail = get_dirty_tail() <= get_alloc_tail() ? + get_dirty_tail() : get_alloc_tail(); set_written_to(tail); return seastar::do_with( bool(false), @@ -367,7 +367,7 @@ Journal::replay_ret CircularBoundedJournal::replay( return d_handler( locator, delta, - header.journal_tail, + header.dirty_tail, header.alloc_tail, modify_time).discard_result(); }); diff --git a/src/crimson/os/seastore/journal/circular_bounded_journal.h b/src/crimson/os/seastore/journal/circular_bounded_journal.h index 02cda0f413126..38b5ca676f32f 100644 --- a/src/crimson/os/seastore/journal/circular_bounded_journal.h +++ b/src/crimson/os/seastore/journal/circular_bounded_journal.h @@ -43,7 +43,7 @@ using RBMDevice = random_block_device::RBMDevice; * * - Replay time * At replay time, CBJournal begins to replay records in CBjournal by reading - * records from journal_tail. Then, CBJournal examines whether the records is valid + * records from dirty_tail. Then, CBJournal examines whether the records is valid * one by one, at which point written_to is recovered * if the valid record is founded. Note that applied_to is stored * permanently when the apply work---applying the records in CBJournal to RBM--- @@ -200,7 +200,7 @@ public: uint64_t size = 0; // max length of journal // start offset of CircularBoundedJournal in the device - journal_seq_t journal_tail; + journal_seq_t dirty_tail; journal_seq_t alloc_tail; device_id_t device_id; @@ -212,7 +212,7 @@ public: denc(v.block_size, p); denc(v.size, p); - denc(v.journal_tail, p); + denc(v.dirty_tail, p); denc(v.alloc_tail, p); denc(v.device_id, p); @@ -234,7 +234,7 @@ public: size_t get_used_size() const { auto rbm_written_to = get_rbm_addr(get_written_to()); - auto rbm_tail = get_rbm_addr(get_journal_tail()); + auto rbm_tail = get_rbm_addr(get_dirty_tail()); return rbm_written_to >= rbm_tail ? rbm_written_to - rbm_tail : rbm_written_to + header.size + get_block_size() @@ -251,14 +251,14 @@ public: } write_ertr::future<> update_journal_tail( - journal_seq_t seq, - journal_seq_t alloc_info) { - header.journal_tail = seq; - header.alloc_tail = alloc_info; + journal_seq_t dirty, + journal_seq_t alloc) { + header.dirty_tail = dirty; + header.alloc_tail = alloc; return write_header(); } - journal_seq_t get_journal_tail() const { - return header.journal_tail; + journal_seq_t get_dirty_tail() const { + return header.dirty_tail; } journal_seq_t get_alloc_tail() const { return header.alloc_tail; diff --git a/src/test/crimson/seastore/test_cbjournal.cc b/src/test/crimson/seastore/test_cbjournal.cc index 4fab32d066140..545012c12ed84 100644 --- a/src/test/crimson/seastore/test_cbjournal.cc +++ b/src/test/crimson/seastore/test_cbjournal.cc @@ -278,7 +278,7 @@ struct cbjournal_test_t : public seastar_test_suite_t, JournalTrimmer return cbj->get_written_to(); } auto get_journal_tail() { - return cbj->get_journal_tail(); + return cbj->get_dirty_tail(); } auto get_used_size() { return cbj->get_used_size(); @@ -437,7 +437,7 @@ TEST_F(cbjournal_test_t, update_header) cbj->close().unsafe_get0(); replay(); - ASSERT_EQ(update_header.journal_tail.offset, update_header.journal_tail.offset); + ASSERT_EQ(update_header.dirty_tail.offset, update_header.dirty_tail.offset); ASSERT_EQ(header.block_size, update_header.block_size); ASSERT_EQ(header.size, update_header.size); }); -- 2.39.5