Set journal/meta devices to data device explicitly instead of ""

Vitaliy Filippov 2022-07-01 11:18:14 +03:00
parent 0c404c5074
commit 4d777c6729
2 changed files with 8 additions and 8 deletions

View File

@ -92,13 +92,13 @@ void blockstore_disk_t::parse_config(std::map<std::string, std::string> & config
{ {
throw std::runtime_error("Block size must be a multiple of sparse write tracking granularity"); throw std::runtime_error("Block size must be a multiple of sparse write tracking granularity");
} }
if (journal_device == meta_device || meta_device == "" && journal_device == data_device) if (meta_device == "")
{ {
journal_device = ""; meta_device = data_device;
} }
if (meta_device == data_device) if (journal_device == "")
{ {
meta_device = ""; journal_device = meta_device;
} }
if (meta_offset % meta_block_size) if (meta_offset % meta_block_size)
{ {
@ -239,7 +239,7 @@ void blockstore_disk_t::open_data()
void blockstore_disk_t::open_meta() void blockstore_disk_t::open_meta()
{ {
if (meta_device != "") if (meta_device != data_device)
{ {
meta_offset = 0; meta_offset = 0;
meta_fd = open(meta_device.c_str(), O_DIRECT|O_RDWR); meta_fd = open(meta_device.c_str(), O_DIRECT|O_RDWR);
@ -278,7 +278,7 @@ void blockstore_disk_t::open_meta()
void blockstore_disk_t::open_journal() void blockstore_disk_t::open_journal()
{ {
if (journal_device != "") if (journal_device != meta_device)
{ {
journal_fd = open(journal_device.c_str(), O_DIRECT|O_RDWR); journal_fd = open(journal_device.c_str(), O_DIRECT|O_RDWR);
if (journal_fd == -1) if (journal_fd == -1)

View File

@ -75,11 +75,11 @@ void blockstore_impl_t::parse_config(blockstore_config_t & config)
{ {
metadata_buf_size = 4*1024*1024; metadata_buf_size = 4*1024*1024;
} }
if (dsk.meta_device == "") if (dsk.meta_device == dsk.data_device)
{ {
disable_meta_fsync = disable_data_fsync; disable_meta_fsync = disable_data_fsync;
} }
if (dsk.journal_device == "") if (dsk.journal_device == dsk.meta_device)
{ {
disable_journal_fsync = disable_meta_fsync; disable_journal_fsync = disable_meta_fsync;
} }