forked from vitalif/vitastor
Calculate data crc32c
parent
9568354d78
commit
74d8ea2f01
|
@ -40,7 +40,8 @@ struct __attribute__((__packed__)) journal_entry_small_write
|
||||||
// small_write entries contain <len> bytes of data which is stored in next sectors
|
// small_write entries contain <len> bytes of data which is stored in next sectors
|
||||||
// data_offset is its offset within journal
|
// data_offset is its offset within journal
|
||||||
uint64_t data_offset;
|
uint64_t data_offset;
|
||||||
// FIXME add & verify data crc32c
|
uint32_t crc32_data;
|
||||||
|
// FIXME verify data crc32c
|
||||||
};
|
};
|
||||||
|
|
||||||
struct __attribute__((__packed__)) journal_entry_big_write
|
struct __attribute__((__packed__)) journal_entry_big_write
|
||||||
|
|
|
@ -139,6 +139,7 @@ int blockstore::dequeue_write(blockstore_operation *op)
|
||||||
je->offset = op->offset;
|
je->offset = op->offset;
|
||||||
je->len = op->len;
|
je->len = op->len;
|
||||||
je->data_offset = journal.next_free;
|
je->data_offset = journal.next_free;
|
||||||
|
je->crc32_data = crc32c(0, op->buf, op->len);
|
||||||
je->crc32 = je_crc32((journal_entry*)je);
|
je->crc32 = je_crc32((journal_entry*)je);
|
||||||
journal.crc32_last = je->crc32;
|
journal.crc32_last = je->crc32;
|
||||||
prepare_journal_sector_write(journal, sqe1, cb);
|
prepare_journal_sector_write(journal, sqe1, cb);
|
||||||
|
|
Loading…
Reference in New Issue