From 5c57c084346fbfe6f3f45236c151ad1c83b6b398 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 23 Jul 2014 16:19:48 +0200 Subject: [PATCH 1/1] null: add FIO_FAKEIO flag Tell the backend that null just fakes IO, and use this knowledge to have verifies automagically work when using null. This allows testing of a wider range of paths with ioengine=null. Signed-off-by: Jens Axboe --- engines/null.c | 4 ++-- ioengine.h | 1 + verify.c | 7 +++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/engines/null.c b/engines/null.c index eb17b113..e7df6a13 100644 --- a/engines/null.c +++ b/engines/null.c @@ -119,7 +119,7 @@ static struct ioengine_ops ioengine = { .init = fio_null_init, .cleanup = fio_null_cleanup, .open_file = fio_null_open, - .flags = FIO_DISKLESSIO, + .flags = FIO_DISKLESSIO | FIO_FAKEIO, }; static void fio_init fio_null_register(void) @@ -152,7 +152,7 @@ void get_ioengine(struct ioengine_ops **ioengine_ptr) ioengine->init = fio_null_init; ioengine->cleanup = fio_null_cleanup; ioengine->open_file = fio_null_open; - ioengine->flags = FIO_DISKLESSIO; + ioengine->flags = FIO_DISKLESSIO | FIO_FAKEIO; } } #endif /* FIO_EXTERNAL_ENGINE */ diff --git a/ioengine.h b/ioengine.h index 29c8487a..ebe0ebe9 100644 --- a/ioengine.h +++ b/ioengine.h @@ -166,6 +166,7 @@ enum fio_ioengine_flags { FIO_BARRIER = 1 << 8, /* engine supports barriers */ FIO_MEMALIGN = 1 << 9, /* engine wants aligned memory */ FIO_BIT_BASED = 1 << 10, /* engine uses a bit base (e.g. uses Kbit as opposed to KB) */ + FIO_FAKEIO = 1 << 11, /* engine pretends to do IO */ }; /* diff --git a/verify.c b/verify.c index 217b6869..3d7c5de9 100644 --- a/verify.c +++ b/verify.c @@ -759,6 +759,13 @@ int verify_io_u(struct thread_data *td, struct io_u **io_u_ptr) if (td->o.verify == VERIFY_NULL || io_u->ddir != DDIR_READ) return 0; + /* + * If the IO engine is faking IO (like null), then just pretend + * we verified everything. + */ + if (td->io_ops->flags & FIO_FAKEIO) + return 0; + if (io_u->flags & IO_U_F_TRIMMED) { ret = verify_trimmed_io_u(td, io_u); goto done; -- 2.25.1