[PATCH] Make unlink and overwrite the default
[fio.git] / verify.c
index 12eb7c984f01c4f25d99347c0e0d0b554fc1fecc..692eb5baeb17161f8d137b539fa0cfa094833e6b 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;
 }
 
-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;
@@ -91,7 +91,7 @@ int verify_io_u(struct io_u *io_u)
        else if (hdr->verify_type == VERIFY_CRC32)
                ret = verify_io_u_crc32(hdr, io_u);
        else {
-               log_err("Bad verify type %d\n", hdr->verify_type);
+               log_err("Bad verify type %u\n", hdr->verify_type);
                ret = 1;
        }
 
@@ -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;
+}