diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-07-26 12:22:30 +0200 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-07-26 12:22:30 +0200 |
commit | b67740d3620aee7c753987cdcf750fa28d871fcf (patch) | |
tree | ced8158301177df42085d01181e5550deb68c583 | |
parent | 4c5946c6606abc87ba7e2bfc57a5030d19b6d4d5 (diff) | |
download | fio-b67740d3620aee7c753987cdcf750fa28d871fcf.tar.gz |
IO verification improvements
- Add a FIO_UNIDIR io ops flag. This like networked IO can't be read/write,
so verify only makes sense for data summed by another writer.
- Allow a read workload to verify previously written data.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | engines/net.c | 2 | ||||
-rw-r--r-- | fio.c | 10 | ||||
-rw-r--r-- | fio.h | 1 | ||||
-rw-r--r-- | init.c | 3 |
4 files changed, 11 insertions, 5 deletions
diff --git a/engines/net.c b/engines/net.c index 52e3b049..0cda953c 100644 --- a/engines/net.c +++ b/engines/net.c @@ -474,7 +474,7 @@ static struct ioengine_ops ioengine_splice = { .cleanup = fio_netio_cleanup, .open_file = fio_netio_open_file, .close_file = generic_close_file, - .flags = FIO_SYNCIO | FIO_DISKLESSIO, + .flags = FIO_SYNCIO | FIO_DISKLESSIO | FIO_UNIDIR, }; static void fio_init fio_netio_register(void) @@ -446,6 +446,13 @@ static void do_io(struct thread_data *td) break; } + /* + * Add verification end_io handler, if asked to verify + * a previously written file. + */ + if (td->o.verify != VERIFY_NONE) + io_u->end_io = verify_io_u; + ret = td_io_queue(td, io_u); switch (ret) { case FIO_Q_COMPLETED: @@ -894,7 +901,8 @@ static void *thread_main(void *data) if (td->error || td->terminate) break; - if (td->o.verify == VERIFY_NONE) + if (td->o.verify == VERIFY_NONE || + (td->io_ops->flags & FIO_UNIDIR)) continue; if (clear_io_state(td)) @@ -243,6 +243,7 @@ enum fio_ioengine_flags { FIO_DISKLESSIO = 1 << 2, /* no disk involved */ FIO_NOEXTEND = 1 << 3, /* engine can't extend file */ FIO_NODISKUTIL = 1 << 4, /* diskutil can't handle filename */ + FIO_UNIDIR = 1 << 5, /* engine is uni-directional */ }; enum fio_file_flags { @@ -222,9 +222,6 @@ static int fixup_options(struct thread_data *td) if (!o->file_size_high) o->file_size_high = o->file_size_low; - if (td_read(td) && !td_rw(td)) - o->verify = 0; - if (o->norandommap && o->verify != VERIFY_NONE) { log_err("fio: norandommap given, verify disabled\n"); o->verify = VERIFY_NONE; |