mirror of
https://github.com/kdave/btrfs-progs
synced 2025-05-02 07:57:58 +00:00
CRC32C big endian bugs...
The CRC32C implementation in the btrfs progs is different from the one in the kernel, so obviously nothing can possibly work on big-endian.
This commit is contained in:
parent
8871a0eaa9
commit
355351fc1d
6
crc32c.c
6
crc32c.c
@ -91,13 +91,11 @@ static const u32 crc32c_table[256] = {
|
|||||||
* crc using table.
|
* crc using table.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
u32 crc32c_le(u32 seed, unsigned char const *data, size_t length)
|
u32 crc32c_le(u32 crc, unsigned char const *data, size_t length)
|
||||||
{
|
{
|
||||||
u32 crc = (__force __u32)(cpu_to_le32(seed));
|
|
||||||
|
|
||||||
while (length--)
|
while (length--)
|
||||||
crc =
|
crc =
|
||||||
crc32c_table[(crc ^ *data++) & 0xFFL] ^ (crc >> 8);
|
crc32c_table[(crc ^ *data++) & 0xFFL] ^ (crc >> 8);
|
||||||
|
|
||||||
return le32_to_cpu((__force __le32)crc);
|
return crc;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user