Skip to content

Commit 8c5756e

Browse files
committed
btrfs-progs: use hash wrapper for crc32c in btrfs_csum_data
Signed-off-by: David Sterba <dsterba@suse.com>
1 parent ebb79f1 commit 8c5756e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

disk-io.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,11 @@ static void print_tree_block_error(struct btrfs_fs_info *fs_info,
141141

142142
int btrfs_csum_data(u16 csum_type, const u8 *data, u8 *out, size_t len)
143143
{
144-
u32 crc = ~(u32)0;
145-
146144
memset(out, 0, BTRFS_CSUM_SIZE);
147145

148146
switch (csum_type) {
149147
case BTRFS_CSUM_TYPE_CRC32:
150-
crc = crc32c(crc, data, len);
151-
put_unaligned_le32(~crc, out);
152-
return 0;
148+
return hash_crc32c(data, len, out);
153149
case BTRFS_CSUM_TYPE_XXHASH:
154150
return hash_xxhash(data, len, out);
155151
default:

0 commit comments

Comments
 (0)