[PATCH] More verify code move
authorJens Axboe <jens.axboe@oracle.com>
Wed, 18 Oct 2006 13:47:42 +0000 (15:47 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 18 Oct 2006 13:47:42 +0000 (15:47 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.c
fio.h
verify.c

diff --git a/fio.c b/fio.c
index cf85765ec2423c3d5a4e3bd1583c1ed8473636d6..2b760ddd4beb0c56244637a626284b6faa47d9f8 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -553,25 +553,11 @@ static void cleanup_pending_aio(struct thread_data *td)
        }
 }
 
        }
 }
 
-static int do_io_u_verify(struct thread_data *td, struct io_u **io_u)
-{
-       struct io_u *v_io_u = *io_u;
-       int ret = 0;
-
-       if (v_io_u) {
-               ret = verify_io_u(v_io_u);
-               put_io_u(td, v_io_u);
-               *io_u = NULL;
-       }
-
-       return ret;
-}
-
 /*
  * The main verify engine. Runs over the writes we previusly submitted,
  * reads the blocks back in, and checks the crc/md5 of the data.
  */
 /*
  * The main verify engine. Runs over the writes we previusly submitted,
  * reads the blocks back in, and checks the crc/md5 of the data.
  */
-static void do_verify(struct thread_data *td)
+void do_verify(struct thread_data *td)
 {
        struct timeval t;
        struct io_u *io_u, *v_io_u = NULL;
 {
        struct timeval t;
        struct io_u *io_u, *v_io_u = NULL;
diff --git a/fio.h b/fio.h
index 9a8184b94716fc9bbaf3c9661e6454158111f5d0..e279574a387026ab07e5b975df2a51fe5d384d0e 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -477,7 +477,7 @@ enum {
  */
 extern void populate_verify_io_u(struct thread_data *, struct io_u *);
 extern int get_next_verify(struct thread_data *td, struct io_u *);
  */
 extern void populate_verify_io_u(struct thread_data *, struct io_u *);
 extern int get_next_verify(struct thread_data *td, struct io_u *);
-extern int verify_io_u(struct io_u *);
+extern int do_io_u_verify(struct thread_data *, struct io_u **);
 
 /*
  * This is a pretty crappy semaphore implementation, but with the use that fio
 
 /*
  * This is a pretty crappy semaphore implementation, but with the use that fio
index 12eb7c984f01c4f25d99347c0e0d0b554fc1fecc..43520bd398992d7292294df13d782917b1e77272 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -78,7 +78,7 @@ static int verify_io_u_md5(struct verify_header *hdr, struct io_u *io_u)
        return 0;
 }
 
        return 0;
 }
 
-int verify_io_u(struct io_u *io_u)
+static int verify_io_u(struct io_u *io_u)
 {
        struct verify_header *hdr = (struct verify_header *) io_u->buf;
        int ret;
 {
        struct verify_header *hdr = (struct verify_header *) io_u->buf;
        int ret;
@@ -155,3 +155,17 @@ int get_next_verify(struct thread_data *td, struct io_u *io_u)
 
        return 1;
 }
 
        return 1;
 }
+
+int do_io_u_verify(struct thread_data *td, struct io_u **io_u)
+{
+       struct io_u *v_io_u = *io_u;
+       int ret = 0;
+
+       if (v_io_u) {
+               ret = verify_io_u(v_io_u);
+               put_io_u(td, v_io_u);
+               *io_u = NULL;
+       }
+
+       return ret;
+}