From: Shawn Lewis Date: Thu, 2 Aug 2007 20:19:32 +0000 (+0200) Subject: [PATCH] Add do_verify option X-Git-Tag: fio-1.17~7 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=e84c73a89ef19f38e117ed4fae5eb3bd4aee8a81 [PATCH] Add do_verify option Signed-off-by: Jens Axboe --- diff --git a/HOWTO b/HOWTO index c38266c2..cdfe80aa 100644 --- a/HOWTO +++ b/HOWTO @@ -569,6 +569,9 @@ loops=int Run the specified number of iterations of this job. Used to repeat the same workload a given number of times. Defaults to 1. +do_verify=int Run the verify phase after a write phase. Only makes sense if + verify is set. Defaults to 1. + verify=str If writing to a file, fio can verify the file contents after each iteration of the job. The allowed values are: diff --git a/eta.c b/eta.c index 39241c5a..350815ee 100644 --- a/eta.c +++ b/eta.c @@ -107,7 +107,7 @@ static int thread_eta(struct thread_data *td, unsigned long elapsed) * if writing, bytes_total will be twice the size. If mixing, * assume a 50/50 split and thus bytes_total will be 50% larger. */ - if (td->o.verify) { + if (td->o.do_verify && td->o.verify) { if (td_rw(td)) bytes_total = bytes_total * 3 / 2; else diff --git a/fio.c b/fio.c index b8cba547..02ed91db 100644 --- a/fio.c +++ b/fio.c @@ -901,7 +901,8 @@ static void *thread_main(void *data) if (td->error || td->terminate) break; - if (td->o.verify == VERIFY_NONE || + if (!td->o.do_verify || + td->o.verify == VERIFY_NONE || (td->io_ops->flags & FIO_UNIDIR)) continue; diff --git a/fio.h b/fio.h index 235a13b1..0373d2af 100644 --- a/fio.h +++ b/fio.h @@ -417,6 +417,7 @@ struct thread_options { unsigned int end_fsync; unsigned int sync_io; unsigned int verify; + unsigned int do_verify; unsigned int verifysort; unsigned int verify_interval; unsigned int verify_offset; diff --git a/options.c b/options.c index a50dece0..cd4b90a7 100644 --- a/options.c +++ b/options.c @@ -599,6 +599,13 @@ static struct fio_option options[] = { #endif }, }, + { + .name = "do_verify", + .type = FIO_OPT_INT, + .off1 = td_var_offset(do_verify), + .help = "Run verification stage after write", + .def = "1", + }, { .name = "verify", .type = FIO_OPT_STR,