Use crc32c for the verify_header checksum
authorJens Axboe <axboe@kernel.dk>
Wed, 22 Feb 2012 19:29:42 +0000 (20:29 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 22 Feb 2012 19:29:42 +0000 (20:29 +0100)
It's the only hardware assisted crypto we have, and it's
widely available in any recent Intel CPU.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
verify.c

index d6abb983a5d6dbcab39a93d3efa822352893d890..f40d7e1154cfa137d012d737319a28f9f520193f 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -651,7 +651,7 @@ static int verify_hdr_crc(struct verify_header *hdr)
        void *p = hdr;
        uint32_t crc;
 
        void *p = hdr;
        uint32_t crc;
 
-       crc = crc32(p, sizeof(*hdr) - sizeof(hdr->crc32));
+       crc = crc32c(p, sizeof(*hdr) - sizeof(hdr->crc32));
        if (crc == hdr->crc32)
                return 1;
 
        if (crc == hdr->crc32)
                return 1;
 
@@ -866,7 +866,7 @@ static void populate_hdr(struct thread_data *td, struct io_u *io_u,
        hdr->pad1 = 0;
        hdr->rand_seed = io_u->rand_seed;
        hdr->pad2 = 0;
        hdr->pad1 = 0;
        hdr->rand_seed = io_u->rand_seed;
        hdr->pad2 = 0;
-       hdr->crc32 = crc32(p, sizeof(*hdr) - sizeof(hdr->crc32));
+       hdr->crc32 = crc32c(p, sizeof(*hdr) - sizeof(hdr->crc32));
 
        data_len = header_len - hdr_size(hdr);
 
 
        data_len = header_len - hdr_size(hdr);