[PATCH] Add do_verify option
authorShawn Lewis <shawnlewis@google.com>
Thu, 2 Aug 2007 20:19:32 +0000 (22:19 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 2 Aug 2007 20:19:32 +0000 (22:19 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
HOWTO
eta.c
fio.c
fio.h
options.c

diff --git a/HOWTO b/HOWTO
index c38266c2afe100fcf02106476c3ae52eb05e4ae1..cdfe80aa9fc4f1908ecf504a9ba5dae1b7a11071 100644 (file)
--- 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 39241c5aaf5a529dee695e86ef09c5c17d1efb15..350815ee6a9e7d244f9131954b8358eb36fbd91f 100644 (file)
--- 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 b8cba547ac931fcdf7ac0b3af79b7b19a7b8af75..02ed91dbcea0b70454fee2b78b68c5041b49107d 100644 (file)
--- 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 235a13b1d8c8f96e996d1c16c9138d2d9afa84e5..0373d2af0fedef8fd9783e45720168d0644af518 100644 (file)
--- 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;
index a50dece0baf4c5fd696df0a9f3fe0384ea9fe4b7..cd4b90a79271bc524d43d90ccfb9084c745f7dcc 100644 (file)
--- 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,