From ea2877a4ab0fb047a503ba0d7a0fd5393d0fb099 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 10 Oct 2006 08:30:24 +0200 Subject: [PATCH] [PATCH] Allow io engine to do the file setup Signed-off-by: Jens Axboe --- engines/fio-engine-cpu.c | 6 ++++++ fio.c | 4 ++-- fio.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/engines/fio-engine-cpu.c b/engines/fio-engine-cpu.c index 6d6fc562..9a32330e 100644 --- a/engines/fio-engine-cpu.c +++ b/engines/fio-engine-cpu.c @@ -1,6 +1,11 @@ #include "fio.h" #include "os.h" +static int fio_cpuio_setup(struct thread_data fio_unused *td) +{ + return 0; +} + static int fio_cpuio_init(struct thread_data *td) { if (!td->cpuload) { @@ -19,5 +24,6 @@ struct ioengine_ops ioengine = { .name = "cpuio", .version = FIO_IOOPS_VERSION, .init = fio_cpuio_init, + .setup = fio_cpuio_setup, .flags = FIO_CPUIO, }; diff --git a/fio.c b/fio.c index 8278b60e..ea57d783 100644 --- a/fio.c +++ b/fio.c @@ -1210,8 +1210,8 @@ static int setup_file(struct thread_data *td) struct stat st; int flags = 0; - if (td->io_ops->flags & FIO_CPUIO) - return 0; + if (td->io_ops->setup) + return td->io_ops->setup(td); if (stat(td->file_name, &st) == -1) { if (errno != ENOENT) { diff --git a/fio.h b/fio.h index 112736c8..db39ea12 100644 --- a/fio.h +++ b/fio.h @@ -455,6 +455,7 @@ struct ioengine_ops { char name[16]; int version; int flags; + int (*setup)(struct thread_data *); int (*init)(struct thread_data *); int (*prep)(struct thread_data *, struct io_u *); int (*queue)(struct thread_data *, struct io_u *); -- 2.25.1