For testing purposes.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
crc32 Use a crc32 sum of the data area and store
it in the header of each block.
+ null Only pretend to verify. Useful for testing
+ internals with ioengine=null, not for much
+ else.
+
This option can be used for repeated burn-in tests of a
system to make sure that the written data is also
correctly read back.
IO_U_F_FLIGHT = 1 << 1,
};
+struct thread_data;
+
/*
* The io unit
*/
/*
* Callback for io completion
*/
- int (*end_io)(struct io_u *);
+ int (*end_io)(struct thread_data *, struct io_u *);
};
/*
VERIFY_NONE = 0, /* no verification */
VERIFY_MD5, /* md5 sum data blocks */
VERIFY_CRC32, /* crc32 sum data blocks */
+ VERIFY_NULL, /* pretend to verify */
};
/*
*/
extern void populate_verify_io_u(struct thread_data *, struct io_u *);
extern int __must_check get_next_verify(struct thread_data *td, struct io_u *);
-extern int __must_check verify_io_u(struct io_u *);
+extern int __must_check verify_io_u(struct thread_data *, struct io_u *);
/*
* Memory helpers
icd->bytes_done[idx] += bytes;
if (io_u->end_io) {
- ret = io_u->end_io(io_u);
+ ret = io_u->end_io(td, io_u);
if (ret && !icd->error)
icd->error = ret;
}
.oval = VERIFY_MD5,
.help = "Use md5 checksums for verification",
},
+ {
+ .ival = "null",
+ .oval = VERIFY_NULL,
+ .help = "Pretend to verify",
+ },
},
},
{
return 0;
}
-int verify_io_u(struct io_u *io_u)
+int verify_io_u(struct thread_data *td, struct io_u *io_u)
{
struct verify_header *hdr = (struct verify_header *) io_u->buf;
int ret;
+ if (td->o.verify == VERIFY_NULL)
+ return 0;
+
if (hdr->fio_magic != FIO_HDR_MAGIC) {
log_err("Bad verify header %x\n", hdr->fio_magic);
return EIO;
if (td->o.verify == VERIFY_MD5) {
fill_md5(&hdr, p, io_u->buflen - sizeof(hdr));
hdr.verify_type = VERIFY_MD5;
- } else {
+ } else if (td->o.verify == VERIFY_CRC32) {
fill_crc32(&hdr, p, io_u->buflen - sizeof(hdr));
hdr.verify_type = VERIFY_CRC32;
}