From 8c5756ec8d1c40f67fc50e092b3a8d0945dae71a Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 25 Sep 2019 19:40:03 +0200 Subject: [PATCH] btrfs-progs: use hash wrapper for crc32c in btrfs_csum_data Signed-off-by: David Sterba --- disk-io.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/disk-io.c b/disk-io.c index e250dcb8..fa679133 100644 --- a/disk-io.c +++ b/disk-io.c @@ -141,15 +141,11 @@ static void print_tree_block_error(struct btrfs_fs_info *fs_info, int btrfs_csum_data(u16 csum_type, const u8 *data, u8 *out, size_t len) { - u32 crc = ~(u32)0; - memset(out, 0, BTRFS_CSUM_SIZE); switch (csum_type) { case BTRFS_CSUM_TYPE_CRC32: - crc = crc32c(crc, data, len); - put_unaligned_le32(~crc, out); - return 0; + return hash_crc32c(data, len, out); case BTRFS_CSUM_TYPE_XXHASH: return hash_xxhash(data, len, out); default: