null: add FIO_FAKEIO flag
authorJens Axboe <axboe@fb.com>
Wed, 23 Jul 2014 14:19:48 +0000 (16:19 +0200)
committerJens Axboe <axboe@fb.com>
Wed, 23 Jul 2014 14:19:48 +0000 (16:19 +0200)
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 <axboe@fb.com>
engines/null.c
ioengine.h
verify.c

index eb17b113ca6034812b9cd7f239a4b1144679b3e7..e7df6a134d479c5ab370f496044619b18f6b15d2 100644 (file)
@@ -119,7 +119,7 @@ static struct ioengine_ops ioengine = {
        .init           = fio_null_init,
        .cleanup        = fio_null_cleanup,
        .open_file      = fio_null_open,
        .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)
 };
 
 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->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 */
 }
 }
 #endif /* FIO_EXTERNAL_ENGINE */
index 29c8487a0c12ca9fd21527792b9a565ac60524f1..ebe0ebe9afb5338e3ab5e08e4087418a308adbdd 100644 (file)
@@ -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_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 */
 };
 
 /*
 };
 
 /*
index 217b686950452944c4f87fae580446f745649b7a..3d7c5de9f6ff78374a3c24ca71735ba519f08462 100644 (file)
--- 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 (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;
        if (io_u->flags & IO_U_F_TRIMMED) {
                ret = verify_trimmed_io_u(td, io_u);
                goto done;