[PATCH] Add do_verify option.

From: Shawn Lewis <shawnlewis_at_google.com>
Date: Thu, 2 Aug 2007 13:18:54 -0700 (PDT)

diff --git a/HOWTO b/HOWTO
index c38266c..cdfe80a 100644
--- a/HOWTO
+++ b/HOWTO
@@ -569,6 +569,9 @@ loops=int Run the specified number of it
                 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 39241c5..350815e 100644
--- a/eta.c
+++ b/eta.c
@@ -107,7 +107,7 @@ static int thread_eta(struct thread_data
          * 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 b8cba54..02ed91d 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 235a13b..0373d2a 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 a50dece..cd4b90a 100644
--- a/options.c
+++ b/options.c
@@ -600,6 +600,13 @@ #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,
                 .off1 = td_var_offset(verify),
Received on Thu Aug 02 2007 - 22:18:54 CEST

This archive was generated by hypermail 2.2.0 : Thu Aug 02 2007 - 22:30:01 CEST