unaligned_intent does not need special handling anymore
This commit is contained in:
@@ -238,14 +238,9 @@ resume_1:
|
||||
flusher->active_flushers++;
|
||||
// Scan versions to flush
|
||||
read_vec.clear();
|
||||
unaligned_intent = NULL;
|
||||
for (auto wr = begin_wr; wr != end_wr; wr = wr->next())
|
||||
{
|
||||
bs->prepare_read(read_vec, cur_obj, wr, 0, bs->dsk.data_block_size);
|
||||
if (wr->flags == (BS_HEAP_INTENT_WRITE|BS_HEAP_STABLE) && !wr->can_be_collapsed(bs->heap))
|
||||
{
|
||||
unaligned_intent = wr;
|
||||
}
|
||||
}
|
||||
overwrite_start = overwrite_end = 0;
|
||||
if (read_vec.size() > 0)
|
||||
@@ -262,8 +257,6 @@ resume_1:
|
||||
{
|
||||
flusher->wanting_meta_fsync++;
|
||||
}
|
||||
// Unaligned intent checksums have to be recalculated by reading data blocks from the disk
|
||||
fill_unaligned_intent_checksums();
|
||||
}
|
||||
// Read buffered data
|
||||
cur_obj = NULL;
|
||||
@@ -430,7 +423,6 @@ void journal_flusher_co::fill_partial_checksum_blocks()
|
||||
{
|
||||
read_to_fill_incomplete = true;
|
||||
int out_pos = read_vec.size();
|
||||
// FIXME: Take end_wr bitmap into account here, now it's incorrect
|
||||
bs->prepare_disk_read(read_vec, out_pos, cur_obj, end_wr,
|
||||
hole_start - hole_start % bs->dsk.csum_block_size, hole_start - hole_start % bs->dsk.csum_block_size + bs->dsk.csum_block_size,
|
||||
hole_start - hole_start % bs->dsk.csum_block_size, hole_start - hole_start % bs->dsk.csum_block_size + bs->dsk.csum_block_size,
|
||||
@@ -445,23 +437,6 @@ void journal_flusher_co::fill_partial_checksum_blocks()
|
||||
});
|
||||
}
|
||||
|
||||
void journal_flusher_co::fill_unaligned_intent_checksums()
|
||||
{
|
||||
if (!unaligned_intent)
|
||||
{
|
||||
return;
|
||||
}
|
||||
assert(unaligned_intent->next() == end_wr);
|
||||
uint32_t blk_start = unaligned_intent->offset, blk_end = unaligned_intent->offset + unaligned_intent->len;
|
||||
blk_start = (blk_start / bs->dsk.csum_block_size) * bs->dsk.csum_block_size;
|
||||
blk_end = ((blk_end-1) / bs->dsk.csum_block_size + 1) * bs->dsk.csum_block_size;
|
||||
bs->find_holes(read_vec, blk_start, blk_end, [&](int & pos, uint32_t start, uint32_t end)
|
||||
{
|
||||
// FIXME: Take end_wr bitmap + unaligned_intent range into account here too
|
||||
bs->prepare_disk_read(read_vec, pos, cur_obj, end_wr, start, end, start, end, COPY_BUF_SKIP_CSUM);
|
||||
});
|
||||
}
|
||||
|
||||
void journal_flusher_co::free_buffers()
|
||||
{
|
||||
for (auto it = read_vec.begin(); it != read_vec.end(); it++)
|
||||
@@ -497,7 +472,8 @@ int journal_flusher_co::check_and_punch_checksums()
|
||||
wr = wr->next();
|
||||
assert(wr);
|
||||
bs->heap->calc_block_checksums(
|
||||
(uint32_t*)wr->get_checksums(bs->heap), vec.buf, wr->get_int_bitmap(bs->heap), vec.offset, vec.offset+vec.len, false,
|
||||
(uint32_t*)((uint8_t*)wr->get_checksums(bs->heap) + vec.offset/bs->dsk.csum_block_size*(bs->dsk.data_csum_type & 0xFF)),
|
||||
vec.buf, wr->get_int_bitmap(bs->heap), vec.offset, vec.offset+vec.len, false,
|
||||
[&](uint32_t mismatch_pos, uint32_t expected_csum, uint32_t real_csum)
|
||||
{
|
||||
printf("Checksum mismatch in object %jx:%jx v%ju in %s area at offset 0x%jx: got %08x, expected %08x\n",
|
||||
|
||||
Reference in New Issue
Block a user