...and partially remove the perversion with bitmap inlining

This commit is contained in:
Vitaliy Filippov
2023-07-29 12:17:18 +03:00
parent 45e07d6294
commit c5274f655b
8 changed files with 18 additions and 33 deletions
+2 -12
View File
@@ -891,17 +891,12 @@ int blockstore_init_journal::handle_journal_part(void *buf, uint64_t done_pos, u
uint64_t dyn_size = bs->dsk.dirty_dyn_size(je->small_write.offset, je->small_write.len);
void *dyn = NULL;
void *dyn_from = (uint8_t*)je + sizeof(journal_entry_small_write);
if (dyn_size <= sizeof(void*))
if (!bs->alloc_dyn_data)
{
// Bitmap without checksum is only 4 bytes for 128k objects, save it inline
// It can even contain 4 byte bitmap + 4 byte CRC32 for 4 kb writes :)
memcpy(&dyn, dyn_from, dyn_size);
}
else if (bs->journal.inmemory)
{
// Journal is kept in memory, refer to it instead of allocating a buffer
dyn = dyn_from;
}
else
{
// FIXME Using large blockstore objects will result in a lot of small
@@ -981,16 +976,11 @@ int blockstore_init_journal::handle_journal_part(void *buf, uint64_t done_pos, u
uint64_t dyn_size = bs->dsk.dirty_dyn_size(je->big_write.offset, je->big_write.len);
void *dyn = NULL;
void *dyn_from = (uint8_t*)je + sizeof(journal_entry_big_write);
if (dyn_size <= sizeof(void*))
if (!bs->alloc_dyn_data)
{
// Bitmap without checksum is only 4 bytes for 128k objects, save it inline
memcpy(&dyn, dyn_from, dyn_size);
}
else if (bs->journal.inmemory)
{
// Journal is kept in memory, refer to it instead of allocating a buffer
dyn = dyn_from;
}
else
{
// FIXME Using large blockstore objects will result in a lot of small