]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cbjournal: rename journal_tail to dirty_tail
authormyoungwon oh <ohmyoungwon@gmail.com>
Tue, 9 Aug 2022 08:05:39 +0000 (17:05 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Fri, 19 Aug 2022 03:42:06 +0000 (12:42 +0900)
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
src/crimson/os/seastore/journal/circular_bounded_journal.cc
src/crimson/os/seastore/journal/circular_bounded_journal.h
src/test/crimson/seastore/test_cbjournal.cc

index b8adef9bd4d4fa0119897e49d1cf525ac45e5ee4..d7a5a11febd02515f9b37ee9af12051994f11c9d 100644 (file)
@@ -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();
              });
index 02cda0f4131261c892b396e850dcb3841d8abf4e..38b5ca676f32f3a3649d87720bb4d6fef418252e 100644 (file)
@@ -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;
index 4fab32d066140fe08ff87087755f2209f7d135d3..545012c12ed843723cf61e8ebc818ba3d5ac38f7 100644 (file)
@@ -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);
   });