btrfs: resurrect btrfs_crc32c()
Commit 9678c54388
("btrfs: Remove custom crc32c init code") removed
the btrfs_crc32c() function, because it was a duplicate of the crc32c()
library function we already have in the kernel.
Resurrect it as a shim wrapper over crc32c() to make following
transformations of the checksumming code in btrfs easier.
Also provide a btrfs_crc32_final() to ease following transformations.
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:

committed by
David Sterba

parent
5852c8b961
commit
65019df8c3
@@ -1135,11 +1135,11 @@ static u64 hash_extent_data_ref(u64 root_objectid, u64 owner, u64 offset)
|
||||
__le64 lenum;
|
||||
|
||||
lenum = cpu_to_le64(root_objectid);
|
||||
high_crc = crc32c(high_crc, &lenum, sizeof(lenum));
|
||||
high_crc = btrfs_crc32c(high_crc, &lenum, sizeof(lenum));
|
||||
lenum = cpu_to_le64(owner);
|
||||
low_crc = crc32c(low_crc, &lenum, sizeof(lenum));
|
||||
low_crc = btrfs_crc32c(low_crc, &lenum, sizeof(lenum));
|
||||
lenum = cpu_to_le64(offset);
|
||||
low_crc = crc32c(low_crc, &lenum, sizeof(lenum));
|
||||
low_crc = btrfs_crc32c(low_crc, &lenum, sizeof(lenum));
|
||||
|
||||
return ((u64)high_crc << 31) ^ (u64)low_crc;
|
||||
}
|
||||
|
Reference in New Issue
Block a user