blob: a93255b4ee275583c483e99c4c6455d58d35321a [file] [log] [blame]
Miguela5eb62e2008-04-11 15:45:51 -04001#include <asm/byteorder.h>
2#include <linux/crc32c.h>
3#include <linux/version.h>
4
5/**
6 * implementation of crc32c_le() changed in linux-2.6.23,
7 * has of v0.13 btrfs-progs is using the latest version.
8 * We must workaround older implementations of crc32c_le()
9 * found on older kernel versions.
10 */
11#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
12#define btrfs_crc32c(seed, data, length) \
13 __cpu_to_le32( crc32c( __le32_to_cpu(seed), data, length) )
14#else
15#define btrfs_crc32c(seed, data, length) \
16 crc32c(seed, data, length)
17#endif