Qu Wenruo | 0e7b854 | 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 | |
Qu Wenruo | 1a61808 | 2020-06-24 18:02:49 +0200 | [diff] [blame^] | 5 | #include <linux/sizes.h> |
| 6 | #include <fs_internal.h> |
Qu Wenruo | 0e7b854 | 2020-06-24 18:02:48 +0200 | [diff] [blame] | 7 | #include "crypto/hash.h" |
| 8 | #include "ctree.h" |
| 9 | #include "disk-io.h" |
| 10 | |
Qu Wenruo | 1a61808 | 2020-06-24 18:02:49 +0200 | [diff] [blame^] | 11 | #define BTRFS_SUPER_INFO_OFFSET SZ_64K |
| 12 | #define BTRFS_SUPER_INFO_SIZE SZ_4K |
Qu Wenruo | 0e7b854 | 2020-06-24 18:02:48 +0200 | [diff] [blame] | 13 | static inline u64 btrfs_name_hash(const char *name, int len) |
| 14 | { |
| 15 | u32 crc; |
| 16 | |
| 17 | crc = crc32c((u32)~1, (unsigned char *)name, len); |
| 18 | |
| 19 | return (u64)crc; |
| 20 | } |
| 21 | |
| 22 | int btrfs_csum_data(u16 csum_type, const u8 *data, u8 *out, size_t len); |
| 23 | |
Qu Wenruo | 1a61808 | 2020-06-24 18:02:49 +0200 | [diff] [blame^] | 24 | int btrfs_read_dev_super(struct blk_desc *desc, struct disk_partition *part, |
| 25 | struct btrfs_super_block *sb); |
| 26 | int btrfs_read_superblock(void); |
Qu Wenruo | 0e7b854 | 2020-06-24 18:02:48 +0200 | [diff] [blame] | 27 | #endif |