diff --git a/src/blockstore/blockstore_disk.cpp b/src/blockstore/blockstore_disk.cpp index a4b6c1c4..8e7d8fc2 100644 --- a/src/blockstore/blockstore_disk.cpp +++ b/src/blockstore/blockstore_disk.cpp @@ -49,6 +49,8 @@ void blockstore_disk_t::parse_config(std::map & config meta_block_target_free_space = parse_size(config["meta_block_target_free_space"]); bitmap_granularity = parse_size(config["bitmap_granularity"]); meta_format = stoull_full(config["meta_format"]); + atomic_write_size = (config.find("atomic_write_size") != config.end() + ? parse_size(config["atomic_write_size"]) : 4096); if (config.find("data_io") == config.end() && config.find("meta_io") == config.end() && config.find("journal_io") == config.end()) diff --git a/src/blockstore/blockstore_disk.h b/src/blockstore/blockstore_disk.h index 0afbe124..7bd89bb1 100644 --- a/src/blockstore/blockstore_disk.h +++ b/src/blockstore/blockstore_disk.h @@ -30,6 +30,8 @@ struct blockstore_disk_t uint32_t journal_block_size = 4096; // Metadata block size - minimum_io_size of the metadata device is the best choice uint32_t meta_block_size = 4096; + // Atomic write size of the data block device + uint32_t atomic_write_size = 4096; // Target free space in metadata blocks uint32_t meta_block_target_free_space = 800; // Sparse write tracking granularity. 4 KB is a good choice. Must be a multiple of disk_alignment diff --git a/src/blockstore/blockstore_write.cpp b/src/blockstore/blockstore_write.cpp index e150753f..9c10041a 100644 --- a/src/blockstore/blockstore_write.cpp +++ b/src/blockstore/blockstore_write.cpp @@ -150,7 +150,7 @@ int blockstore_impl_t::dequeue_write(blockstore_op_t *op) // parallel writes to the same object are forbidden anyway else if (dsk.disable_data_fsync && op->opcode == BS_OP_WRITE_STABLE && - op->len > 0 && op->len <= dsk.bitmap_granularity /* FIXME atomic_write_size */ && + op->len > 0 && op->len <= dsk.atomic_write_size && (obj->get_writes()->flags == (BS_HEAP_BIG_WRITE|BS_HEAP_STABLE) || obj->get_writes()->flags == (BS_HEAP_INTENT_WRITE|BS_HEAP_STABLE))) {