From edc5fa12aa76cf7b2538fb5f6ad1ab4e09e26bbf Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 9 Oct 2017 09:13:52 -0600 Subject: [PATCH] engines/filecreate: a few fixes - Ensure that it shows up in the engine list - Ensure that we actually do anything, if the user configures the size too small. Signed-off-by: Jens Axboe --- engines/filecreate.c | 14 +++++++++++++- options.c | 4 ++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/engines/filecreate.c b/engines/filecreate.c index 284aaf39..e078f067 100644 --- a/engines/filecreate.c +++ b/engines/filecreate.c @@ -69,11 +69,23 @@ static int queue_io(struct thread_data *td, struct io_u fio_unused *io_u) return FIO_Q_COMPLETED; } +/* + * Ensure that we at least have a block size worth of IO to do for each + * file. If the job file has td->o.size < nr_files * block_size, then + * fio won't do anything. + */ +static int get_file_size(struct thread_data *td, struct fio_file *f) +{ + f->real_file_size = td_min_bs(td); + return 0; +} + static struct ioengine_ops ioengine = { .name = "filecreate", .version = FIO_IOOPS_VERSION, - .open_file = open_file, .queue = queue_io, + .get_file_size = get_file_size, + .open_file = open_file, .close_file = generic_close_file, .flags = FIO_DISKLESSIO | FIO_SYNCIO | FIO_FAKEIO, }; diff --git a/options.c b/options.c index 5c1abe91..ddcc4e5a 100644 --- a/options.c +++ b/options.c @@ -1843,6 +1843,10 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .help = "DAX Device based IO engine", }, #endif + { + .ival = "filecreate", + .help = "File creation engine", + }, { .ival = "external", .help = "Load external engine (append name)", .cb = str_ioengine_external_cb, -- 2.25.1