<< ", 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}
<< ")";
}
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 {}",
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),
return d_handler(
locator,
delta,
- header.journal_tail,
+ header.dirty_tail,
header.alloc_tail,
modify_time).discard_result();
});
*
* - 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---
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;
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);
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()
}
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;
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();
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);
});