Fix ETA display for iolog replay
[fio.git] / verify.c
index 8427b6f9deb8fd4a6757b5e512b0e1197259a5a2..7c12491d12d470a1de78759eaeed7d2ea7a8954e 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -81,7 +81,7 @@ static void fill_pattern(struct thread_data *td, void *p, unsigned int len)
        }
 }
 
-static void memswp(void* buf1, void* buf2, unsigned int len)
+static void memswp(void *buf1, void *buf2, unsigned int len)
 {
        char swap[200];
 
@@ -112,6 +112,7 @@ static inline unsigned int __hdr_size(int verify_type)
        switch (verify_type) {
        case VERIFY_NONE:
        case VERIFY_NULL:
+       case VERIFY_PATTERN:
                len = 0;
                break;
        case VERIFY_MD5:
@@ -347,7 +348,7 @@ static unsigned int hweight8(unsigned int w)
 }
 
 int verify_io_u_pattern(unsigned long pattern, unsigned long pattern_size,
-                        charbuf, unsigned int len, unsigned int mod)
+                        char *buf, unsigned int len, unsigned int mod)
 {
        unsigned int i;
        char split_pattern[4];
@@ -405,19 +406,6 @@ int verify_io_u(struct thread_data *td, struct io_u *io_u)
                        return EIO;
                }
 
-               if (td->o.verify_pattern_bytes) {
-                       ret = verify_io_u_pattern(td->o.verify_pattern,
-                                                 td->o.verify_pattern_bytes,
-                                                 p + hdr_size,
-                                                 hdr_inc - hdr_size,
-                                                 hdr_size % 4);
-                       if (ret)
-                               log_err("fio: verify failed at %llu/%u\n",
-                                       io_u->offset + hdr_num * hdr->len,
-                                       hdr->len);
-                       continue;
-               }
-
                switch (hdr->verify_type) {
                case VERIFY_MD5:
                        ret = verify_io_u_md5(hdr, io_u, hdr_num);
@@ -443,6 +431,17 @@ int verify_io_u(struct thread_data *td, struct io_u *io_u)
                case VERIFY_META:
                        ret = verify_io_u_meta(hdr, td, io_u, hdr_num);
                        break;
+               case VERIFY_PATTERN:
+                       ret = verify_io_u_pattern(td->o.verify_pattern,
+                                                 td->o.verify_pattern_bytes,
+                                                 p + hdr_size,
+                                                 hdr_inc - hdr_size,
+                                                 hdr_size % 4);
+                       if (ret)
+                               log_err("fio: verify failed at %llu/%u\n",
+                                       io_u->offset + hdr_num * hdr->len,
+                                       hdr->len);
+                       break;
                default:
                        log_err("Bad verify type %u\n", hdr->verify_type);
                        ret = 1;
@@ -581,6 +580,8 @@ void populate_verify_io_u(struct thread_data *td, struct io_u *io_u)
                case VERIFY_META:
                        fill_meta(hdr, td, io_u, header_num);
                        break;
+               case VERIFY_PATTERN:
+                       break;
                default:
                        log_err("fio: bad verify type: %d\n", td->o.verify);
                        assert(0);