Add "fsync disabled" mode
This commit is contained in:
+14
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user