+static int verify_io_u_crc7(struct verify_header *hdr, struct io_u *io_u)
+{
+ unsigned char *p = io_u->buf;
+ unsigned char c;
+
+ p += sizeof(*hdr);
+ c = crc7(p, hdr->len - sizeof(*hdr));
+
+ if (c != hdr->crc7) {
+ log_err("crc7: verify failed at %llu/%lu\n", io_u->offset, io_u->buflen);
+ log_err("crc7: wanted %x, got %x\n", hdr->crc7, c);
+ return 1;
+ }
+
+ return 0;
+}
+
+static int verify_io_u_crc16(struct verify_header *hdr, struct io_u *io_u)
+{
+ unsigned char *p = io_u->buf;
+ unsigned short c;
+
+ p += sizeof(*hdr);
+ c = crc16(p, hdr->len - sizeof(*hdr));
+
+ if (c != hdr->crc16) {
+ log_err("crc16: verify failed at %llu/%lu\n", io_u->offset, io_u->buflen);
+ log_err("crc16: wanted %x, got %x\n", hdr->crc16, c);
+ return 1;
+ }
+
+ return 0;
+}
+
+static int verify_io_u_crc64(struct verify_header *hdr, struct io_u *io_u)
+{
+ unsigned char *p = io_u->buf + sizeof(*hdr);
+ unsigned long long c;
+
+ c = crc64(p, hdr->len - sizeof(*hdr));
+
+ if (c != hdr->crc64) {
+ log_err("crc64: verify failed at %llu/%lu\n", io_u->offset, io_u->buflen);
+ log_err("crc64: wanted %llx, got %llx\n", hdr->crc64, c);
+ return 1;
+ }
+
+ return 0;
+}
+