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 <axboe@fb.com>
diff --git a/engines/null.c b/engines/null.c
index eb17b11..e7df6a1 100644
--- a/engines/null.c
+++ b/engines/null.c
@@ -119,7 +119,7 @@
.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 @@
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 29c8487..ebe0ebe 100644
--- a/ioengine.h
+++ b/ioengine.h
@@ -166,6 +166,7 @@
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 217b686..3d7c5de 100644
--- a/verify.c
+++ b/verify.c
@@ -759,6 +759,13 @@
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;