Add "fsync disabled" mode

This commit is contained in:
Vitaliy Filippov
2019-12-01 16:41:07 +03:00
parent 76655929c4
commit 00eeedae90
7 changed files with 77 additions and 44 deletions
+14 -1
View File
@@ -34,7 +34,7 @@ struct bs_data
struct bs_options
{
int __pad;
char *data_device, *meta_device, *journal_device;
char *data_device = NULL, *meta_device = NULL, *journal_device = NULL, *disable_fsync = NULL;
};
static struct fio_option options[] = {
@@ -65,6 +65,15 @@ static struct fio_option options[] = {
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_FILENAME,
},
{
.name = "disable_fsync",
.lname = "Disable fsync",
.type = FIO_OPT_STR_STORE,
.off1 = offsetof(struct bs_options, disable_fsync),
.help = "Disable fsyncs for blockstore (unsafe if your disk has cache)",
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_FILENAME,
},
{
.name = NULL,
},
@@ -130,6 +139,10 @@ 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->disable_fsync)
config["disable_fsync"] = o->disable_fsync;
if (read_only)
config["readonly"] = "true";
bsd->ringloop = new ring_loop_t(512);
bsd->bs = new blockstore(config, bsd->ringloop);
while (1)