From: Jens Axboe Date: Wed, 18 Oct 2006 13:47:42 +0000 (+0200) Subject: [PATCH] More verify code move X-Git-Tag: fio-1.7~20 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=a9619d44b439ac9c0d292925a5b4fd1b944d1263 [PATCH] More verify code move Signed-off-by: Jens Axboe --- diff --git a/fio.c b/fio.c index cf85765e..2b760ddd 100644 --- 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. */ -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; diff --git a/fio.h b/fio.h index 9a8184b9..e279574a 100644 --- 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 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 diff --git a/verify.c b/verify.c index 12eb7c98..43520bd3 100644 --- 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; } -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; @@ -155,3 +155,17 @@ int get_next_verify(struct thread_data *td, struct io_u *io_u) 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; +}