#include <linux/blkdev.h>
#include <linux/slab.h>
#include <linux/raid/md_p.h>
-#include <linux/crc32.h>
+#include <linux/crc32c.h>
#include <linux/random.h>
#include "md.h"
#include "raid5.h"
block = page_address(io->meta_page);
block->meta_size = cpu_to_le32(io->meta_offset);
- crc = crc32_le(log->uuid_checksum, (void *)block, PAGE_SIZE);
+ crc = crc32c_le(log->uuid_checksum, block, PAGE_SIZE);
block->checksum = cpu_to_le32(crc);
log->current_io = NULL;
if (test_bit(STRIPE_LOG_TRAPPED, &sh->state))
continue;
addr = kmap_atomic(sh->dev[i].page);
- sh->dev[i].log_checksum = crc32_le(log->uuid_checksum,
- addr, PAGE_SIZE);
+ sh->dev[i].log_checksum = crc32c_le(log->uuid_checksum,
+ addr, PAGE_SIZE);
kunmap_atomic(addr);
}
parity_pages = 1 + !!(sh->qd_idx >= 0);
le64_to_cpu(mb->position) != ctx->pos)
return -EINVAL;
- crc = crc32_le(log->uuid_checksum, (void *)mb, PAGE_SIZE);
+ crc = crc32c_le(log->uuid_checksum, mb, PAGE_SIZE);
if (stored_crc != crc)
return -EINVAL;
if (!test_bit(R5_Wantwrite, &sh->dev[disk_index].flags))
continue;
addr = kmap_atomic(sh->dev[disk_index].page);
- checksum = crc32_le(log->uuid_checksum, addr, PAGE_SIZE);
+ checksum = crc32c_le(log->uuid_checksum, addr, PAGE_SIZE);
kunmap_atomic(addr);
if (checksum != sh->dev[disk_index].log_checksum)
goto error;
mb->meta_size = cpu_to_le32(sizeof(struct r5l_meta_block));
mb->seq = cpu_to_le64(seq);
mb->position = cpu_to_le64(pos);
- crc = crc32_le(log->uuid_checksum, (void *)mb, PAGE_SIZE);
+ crc = crc32c_le(log->uuid_checksum, mb, PAGE_SIZE);
mb->checksum = cpu_to_le32(crc);
if (!sync_page_io(log->rdev, pos, PAGE_SIZE, page, WRITE_FUA, false)) {
}
stored_crc = le32_to_cpu(mb->checksum);
mb->checksum = 0;
- expected_crc = crc32_le(log->uuid_checksum, (void *)mb, PAGE_SIZE);
+ expected_crc = crc32c_le(log->uuid_checksum, mb, PAGE_SIZE);
if (stored_crc != expected_crc) {
create_super = true;
goto create;
return -ENOMEM;
log->rdev = rdev;
- log->uuid_checksum = crc32_le(~0, (void *)rdev->mddev->uuid,
- sizeof(rdev->mddev->uuid));
+ log->uuid_checksum = crc32c_le(~0, rdev->mddev->uuid,
+ sizeof(rdev->mddev->uuid));
mutex_init(&log->io_mutex);