From d24860b51af3d358f3701d948f49e89091403a7f Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Mon, 2 Dec 2019 15:50:55 +0300 Subject: [PATCH] Allow to specify blockstore block size in fio options --- fio_engine.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/fio_engine.cpp b/fio_engine.cpp index 2ceeb3d3..ee5f7eda 100644 --- a/fio_engine.cpp +++ b/fio_engine.cpp @@ -34,7 +34,7 @@ struct bs_data struct bs_options { int __pad; - char *data_device = NULL, *meta_device = NULL, *journal_device = NULL, *disable_fsync = NULL; + char *data_device = NULL, *meta_device = NULL, *journal_device = NULL, *disable_fsync = NULL, *block_size_order = NULL; }; static struct fio_option options[] = { @@ -74,6 +74,15 @@ static struct fio_option options[] = { .category = FIO_OPT_C_ENGINE, .group = FIO_OPT_G_FILENAME, }, + { + .name = "block_size_order", + .lname = "Power of 2 for blockstore block size", + .type = FIO_OPT_STR_STORE, + .off1 = offsetof(struct bs_options, block_size_order), + .help = "Set blockstore block size to 2^this value (from 12 to 27)", + .category = FIO_OPT_C_ENGINE, + .group = FIO_OPT_G_FILENAME, + }, { .name = NULL, }, @@ -139,6 +148,8 @@ static int bs_init(struct thread_data *td) config["journal_device"] = o->journal_device; config["meta_device"] = o->meta_device; config["data_device"] = o->data_device; + if (o->block_size_order) + config["block_size_order"] = o->block_size_order; if (o->disable_fsync) config["disable_fsync"] = o->disable_fsync; if (read_only)