device->get_block_size());
ceph::bufferlist bl;
CircularBoundedJournal::cbj_header_t head;
- head.magic = CBJOURNAL_MAGIC;
- head.uuid = uuid_d(); // TODO
head.block_size = config.block_size;
rbm_abs_addr end_addr = convert_paddr_to_abs_addr(
config.end);
head.size = end_addr - start_addr
- device->get_block_size();
- head.used_size = 0;
- head.error = 0;
head.start_offset = device->get_block_size();
- head.last_committed_record_base = 0;
head.written_to = head.start_offset;
head.applied_to = head.start_offset;
- head.flag = 0;
- head.csum_type = 0;
- head.csum = 0;
- head.cur_segment_seq = 0;
head.start = start_addr;
head.end = end_addr;
head.device_id = config.device_id;
*/
struct cbj_header_t {
- uint64_t magic;
+ uint64_t magic = CBJOURNAL_MAGIC;
uuid_d uuid;
- uint64_t block_size; // aligned with block_size
- uint64_t size; // max length of journal
- uint64_t used_size; // current used_size of journal
- uint32_t error; // reserved
-
- rbm_abs_addr start_offset; // start offset of CircularBoundedJournal
- rbm_abs_addr last_committed_record_base;
- rbm_abs_addr written_to;
- rbm_abs_addr applied_to;
-
- uint64_t flag; // represent features (reserved)
- uint8_t csum_type; // type of checksum algoritghm used in cbj_header_t
- uint64_t csum; // checksum of entire cbj_header_t
- uint32_t cur_segment_seq;
-
- rbm_abs_addr start; // start address of the device
- rbm_abs_addr end; // start address of the device
+ uint64_t block_size = 0; // aligned with block_size
+ uint64_t size = 0; // max length of journal
+ uint64_t used_size = 0; // current used_size of journal
+ uint32_t error = 0; // reserved
+
+ rbm_abs_addr start_offset = 0; // start offset of CircularBoundedJournal
+ rbm_abs_addr last_committed_record_base = 0;
+ rbm_abs_addr written_to = 0;
+ rbm_abs_addr applied_to = 0;
+
+ uint64_t flag = 0; // represent features (reserved)
+ uint8_t csum_type = 0; // type of checksum algoritghm used in cbj_header_t
+ uint64_t csum = 0; // checksum of entire cbj_header_t
+ uint32_t cur_segment_seq = 0;
+
+ rbm_abs_addr start = 0; // start address of the device
+ rbm_abs_addr end = 0; // start address of the device
device_id_t device_id;
DENC(cbj_header_t, v, p) {