diff options
author | Qu Wenruo <wqu@suse.com> | 2020-06-24 18:02:55 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-09-07 20:57:27 -0400 |
commit | 75b0817babe733ecf8d503c3ecce371e9991ca76 (patch) | |
tree | 9d8fa004e9265b872cb2ce9df1e2f49c15bf1d87 /fs/btrfs/disk-io.h | |
parent | b1f0067aba5cc51540922e4187d5e8c8f77b1431 (diff) |
fs: btrfs: Crossport read_tree_block() from btrfs-progs
This is the one of the basic stone function for btrfs, which:
- Resolves the chunk mappings
- Reads data from disk
- Does various sanity check
With read_tree_block(), we can finally crossport needed btrfs btree
operations to U-Boot.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Marek BehĂșn <marek.behun@nic.cz>
Diffstat (limited to 'fs/btrfs/disk-io.h')
-rw-r--r-- | fs/btrfs/disk-io.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h index 35b92939467..ca731a5245d 100644 --- a/fs/btrfs/disk-io.h +++ b/fs/btrfs/disk-io.h @@ -10,9 +10,23 @@ #define BTRFS_SUPER_INFO_OFFSET SZ_64K #define BTRFS_SUPER_INFO_SIZE SZ_4K -int btrfs_csum_data(u16 csum_type, const u8 *data, u8 *out, size_t len); +/* U-boot specific */ +int btrfs_read_superblock(void); + +/* From btrfs-progs */ +int read_whole_eb(struct btrfs_fs_info *info, struct extent_buffer *eb, int mirror); +struct extent_buffer* read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr, + u64 parent_transid); +struct extent_buffer* btrfs_find_create_tree_block( + struct btrfs_fs_info *fs_info, u64 bytenr); +struct extent_buffer *btrfs_find_tree_block(struct btrfs_fs_info *fs_info, + u64 bytenr, u32 blocksize); int btrfs_read_dev_super(struct blk_desc *desc, struct disk_partition *part, struct btrfs_super_block *sb); -int btrfs_read_superblock(void); +int btrfs_buffer_uptodate(struct extent_buffer *buf, u64 parent_transid); +int btrfs_set_buffer_uptodate(struct extent_buffer *buf); +int btrfs_csum_data(u16 csum_type, const u8 *data, u8 *out, size_t len); +int csum_tree_block_size(struct extent_buffer *buf, u16 csum_sectorsize, + int verify, u16 csum_type); #endif |