btrfs-progs: remove btrfs_crc32c alias

There's an ancient macro btrfs_crc32c which is just wrapping crc32c and
not doing anything else, so we can use the crc helper directly.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2021-09-22 20:41:07 +02:00
parent 2e2c7c0fc6
commit 732d73dc1f
3 changed files with 5 additions and 5 deletions

View File

@ -29,5 +29,5 @@ u32 crc32c_le(u32 seed, unsigned char const *data, size_t length);
void crc32c_optimization_init(void);
#define crc32c(seed, data, length) crc32c_le(seed, (unsigned char const *)data, length)
#define btrfs_crc32c crc32c
#endif

View File

@ -2553,7 +2553,7 @@ static inline u64 btrfs_name_hash(const char *name, int len)
static inline u64 btrfs_extref_hash(u64 parent_objectid, const char *name,
int len)
{
return (u64)btrfs_crc32c(parent_objectid, name, len);
return (u64)crc32c(parent_objectid, name, len);
}
/* extent-tree.c */

View File

@ -525,11 +525,11 @@ u64 hash_extent_data_ref(u64 root_objectid, u64 owner, u64 offset)
__le64 lenum;
lenum = cpu_to_le64(root_objectid);
high_crc = btrfs_crc32c(high_crc, &lenum, sizeof(lenum));
high_crc = crc32c(high_crc, &lenum, sizeof(lenum));
lenum = cpu_to_le64(owner);
low_crc = btrfs_crc32c(low_crc, &lenum, sizeof(lenum));
low_crc = crc32c(low_crc, &lenum, sizeof(lenum));
lenum = cpu_to_le64(offset);
low_crc = btrfs_crc32c(low_crc, &lenum, sizeof(lenum));
low_crc = crc32c(low_crc, &lenum, sizeof(lenum));
return ((u64)high_crc << 31) ^ (u64)low_crc;
}