Qu Wenruo | 565a414 | 2020-06-24 18:02:48 +0200 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
2 | #ifndef __BTRFS_DISK_IO_H__ | ||||
3 | #define __BTRFS_DISK_IO_H__ | ||||
4 | |||||
5 | #include "crypto/hash.h" | ||||
6 | #include "ctree.h" | ||||
7 | #include "disk-io.h" | ||||
8 | |||||
9 | static inline u64 btrfs_name_hash(const char *name, int len) | ||||
10 | { | ||||
11 | u32 crc; | ||||
12 | |||||
13 | crc = crc32c((u32)~1, (unsigned char *)name, len); | ||||
14 | |||||
15 | return (u64)crc; | ||||
16 | } | ||||
17 | |||||
18 | int btrfs_csum_data(u16 csum_type, const u8 *data, u8 *out, size_t len); | ||||
19 | |||||
20 | #endif |