Update include/linux/crc32c.h to map crc32c() and crc32c_le() macros to ext4l_crc32c(), which uses the correct Castagnoli polynomial (0x82F63B78) required for ext4 checksums. This avoids conflicts with other filesystems like btrfs that have their own crc32c() implementation. Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com>
23 lines
682 B
C
23 lines
682 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* CRC32C definitions for ext4l
|
|
*
|
|
* CRC32C (Castagnoli) uses polynomial 0x1EDC6F41 (bit-reflected: 0x82F63B78)
|
|
* This is different from standard CRC32 (IEEE 802.3) which uses 0x04C11DB7.
|
|
*
|
|
* ext4l provides its own implementation to avoid conflicts with other
|
|
* filesystems (e.g., btrfs) that have their own crc32c().
|
|
*/
|
|
#ifndef _LINUX_CRC32C_H
|
|
#define _LINUX_CRC32C_H
|
|
|
|
#include <asm/byteorder.h>
|
|
#include <linux/types.h>
|
|
|
|
u32 ext4l_crc32c(u32 crc, const void *address, unsigned int length);
|
|
|
|
#define crc32c(crc, p, len) ext4l_crc32c(crc, p, len)
|
|
#define crc32c_le(crc, p, len) ext4l_crc32c(crc, p, len)
|
|
|
|
#endif /* _LINUX_CRC32C_H */
|