+ unsigned char *p = io_u->buf;
+ unsigned char c;
+
+ p += header_num * hdr->len + sizeof(*hdr);
+ c = crc7(p, hdr->len - sizeof(*hdr));
+
+ if (c != hdr->crc7) {
+ log_err("crc7: verify failed at %llu/%u\n",
+ io_u->offset + header_num * hdr->len,
+ hdr->len);
+ 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 int header_num)
+{
+ unsigned char *p = io_u->buf;
+ unsigned short c;
+
+ p += header_num * hdr->len + sizeof(*hdr);
+ c = crc16(p, hdr->len - sizeof(*hdr));
+
+ if (c != hdr->crc16) {
+ log_err("crc16: verify failed at %llu/%u\n",
+ io_u->offset + header_num * hdr->len,
+ hdr->len);
+ 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 int header_num)
+{
+ unsigned char *p = io_u->buf;
+ unsigned long long c;
+
+ p += header_num * hdr->len + sizeof(*hdr);
+ c = crc64(p, hdr->len - sizeof(*hdr));
+
+ if (c != hdr->crc64) {
+ log_err("crc64: verify failed at %llu/%u\n",
+ io_u->offset + header_num * hdr->len,
+ hdr->len);
+ log_err("crc64: wanted %llx, got %llx\n", hdr->crc64, c);
+ return 1;
+ }
+
+ return 0;
+}
+
+static int verify_io_u_crc32(struct verify_header *hdr, struct io_u *io_u,
+ unsigned int header_num)
+{
+ unsigned char *p = io_u->buf;