crc32c.h 534 B

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