disk-io.h 389 B

1234567891011121314151617181920
  1. // SPDX-License-Identifier: GPL-2.0+
  2. #ifndef __BTRFS_DISK_IO_H__
  3. #define __BTRFS_DISK_IO_H__
  4. #include "crypto/hash.h"
  5. #include "ctree.h"
  6. #include "disk-io.h"
  7. static inline u64 btrfs_name_hash(const char *name, int len)
  8. {
  9. u32 crc;
  10. crc = crc32c((u32)~1, (unsigned char *)name, len);
  11. return (u64)crc;
  12. }
  13. int btrfs_csum_data(u16 csum_type, const u8 *data, u8 *out, size_t len);
  14. #endif