engines/filecreate: a few fixes
authorJens Axboe <axboe@kernel.dk>
Mon, 9 Oct 2017 15:13:52 +0000 (09:13 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 Oct 2017 15:13:52 +0000 (09:13 -0600)
- 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 <axboe@kernel.dk>
engines/filecreate.c
options.c

index 284aaf398328177d11bcf9fd549090aa42e7d5c1..e078f067fb51e572c80406d0ad2b70f4ac0ad23a 100644 (file)
@@ -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,
 };
index 5c1abe91817dc7c3ba62fab0108fbac041f3c032..ddcc4e5adc140a90d7b26884ebcea2e3692f4eda 100644 (file)
--- 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,