Fix blockstore initialization after moving clean_dyn_size calc to calc_lengths
This commit is contained in:
@@ -12,14 +12,14 @@ blockstore_impl_t::blockstore_impl_t(blockstore_config_t & config, ring_loop_t *
|
|||||||
ringloop->register_consumer(&ring_consumer);
|
ringloop->register_consumer(&ring_consumer);
|
||||||
initialized = 0;
|
initialized = 0;
|
||||||
parse_config(config, true);
|
parse_config(config, true);
|
||||||
zero_object = (uint8_t*)memalign_or_die(MEM_ALIGNMENT, dsk.data_block_size);
|
|
||||||
alloc_dyn_data = dsk.clean_dyn_size > sizeof(void*) || dsk.csum_block_size > 0;
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
dsk.open_data();
|
dsk.open_data();
|
||||||
dsk.open_meta();
|
dsk.open_meta();
|
||||||
dsk.open_journal();
|
dsk.open_journal();
|
||||||
calc_lengths();
|
calc_lengths();
|
||||||
|
alloc_dyn_data = dsk.clean_dyn_size > sizeof(void*) || dsk.csum_block_size > 0;
|
||||||
|
zero_object = (uint8_t*)memalign_or_die(MEM_ALIGNMENT, dsk.data_block_size);
|
||||||
data_alloc = new allocator_t(dsk.block_count);
|
data_alloc = new allocator_t(dsk.block_count);
|
||||||
}
|
}
|
||||||
catch (std::exception & e)
|
catch (std::exception & e)
|
||||||
@@ -34,7 +34,8 @@ blockstore_impl_t::~blockstore_impl_t()
|
|||||||
{
|
{
|
||||||
delete data_alloc;
|
delete data_alloc;
|
||||||
delete flusher;
|
delete flusher;
|
||||||
free(zero_object);
|
if (zero_object)
|
||||||
|
free(zero_object);
|
||||||
ringloop->unregister_consumer(&ring_consumer);
|
ringloop->unregister_consumer(&ring_consumer);
|
||||||
dsk.close_all();
|
dsk.close_all();
|
||||||
if (metadata_buffer)
|
if (metadata_buffer)
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ class blockstore_impl_t
|
|||||||
int unsynced_queued_ops = 0;
|
int unsynced_queued_ops = 0;
|
||||||
allocator_t *data_alloc = NULL;
|
allocator_t *data_alloc = NULL;
|
||||||
uint64_t used_blocks = 0;
|
uint64_t used_blocks = 0;
|
||||||
uint8_t *zero_object;
|
uint8_t *zero_object = NULL;
|
||||||
|
|
||||||
void *metadata_buffer = NULL;
|
void *metadata_buffer = NULL;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user