]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
21a14fac MB |
2 | /* |
3 | * BTRFS filesystem implementation for U-Boot | |
4 | * | |
5 | * 2017 Marek Behun, CZ.NIC, [email protected] | |
21a14fac MB |
6 | */ |
7 | ||
8 | #ifndef __BTRFS_BTRFS_H__ | |
9 | #define __BTRFS_BTRFS_H__ | |
10 | ||
11 | #include <linux/rbtree.h> | |
12 | #include "conv-funcs.h" | |
13 | ||
14 | struct btrfs_info { | |
15 | struct btrfs_super_block sb; | |
16 | struct btrfs_root_backup *root_backup; | |
17 | ||
18 | struct btrfs_root tree_root; | |
19 | struct btrfs_root fs_root; | |
20 | struct btrfs_root chunk_root; | |
21 | ||
22 | struct rb_root chunks_root; | |
23 | }; | |
24 | ||
25 | extern struct btrfs_info btrfs_info; | |
26 | ||
27 | /* hash.c */ | |
28 | void btrfs_hash_init(void); | |
29 | u32 btrfs_crc32c(u32, const void *, size_t); | |
30 | u32 btrfs_csum_data(char *, u32, size_t); | |
31 | void btrfs_csum_final(u32, void *); | |
32 | ||
33 | static inline u64 btrfs_name_hash(const char *name, int len) | |
34 | { | |
35 | return btrfs_crc32c((u32) ~1, name, len); | |
36 | } | |
37 | ||
38 | /* dev.c */ | |
39 | extern struct blk_desc *btrfs_blk_desc; | |
40 | extern disk_partition_t *btrfs_part_info; | |
41 | ||
42 | int btrfs_devread(u64, int, void *); | |
43 | ||
44 | /* chunk-map.c */ | |
45 | u64 btrfs_map_logical_to_physical(u64); | |
46 | int btrfs_chunk_map_init(void); | |
47 | void btrfs_chunk_map_exit(void); | |
48 | int btrfs_read_chunk_tree(void); | |
49 | ||
50 | /* compression.c */ | |
51 | u32 btrfs_decompress(u8 type, const char *, u32, char *, u32); | |
52 | ||
53 | /* super.c */ | |
54 | int btrfs_read_superblock(void); | |
55 | ||
56 | /* dir-item.c */ | |
57 | typedef int (*btrfs_readdir_callback_t)(const struct btrfs_root *, | |
58 | struct btrfs_dir_item *); | |
59 | ||
60 | int btrfs_lookup_dir_item(const struct btrfs_root *, u64, const char *, int, | |
61 | struct btrfs_dir_item *); | |
62 | int btrfs_readdir(const struct btrfs_root *, u64, btrfs_readdir_callback_t); | |
63 | ||
64 | /* root.c */ | |
65 | int btrfs_find_root(u64, struct btrfs_root *, struct btrfs_root_item *); | |
66 | u64 btrfs_lookup_root_ref(u64, struct btrfs_root_ref *, char *); | |
67 | ||
68 | /* inode.c */ | |
69 | u64 btrfs_lookup_inode_ref(struct btrfs_root *, u64, struct btrfs_inode_ref *, | |
70 | char *); | |
71 | int btrfs_lookup_inode(const struct btrfs_root *, struct btrfs_key *, | |
72 | struct btrfs_inode_item *, struct btrfs_root *); | |
73 | int btrfs_readlink(const struct btrfs_root *, u64, char *); | |
74 | u64 btrfs_lookup_path(struct btrfs_root *, u64, const char *, u8 *, | |
75 | struct btrfs_inode_item *, int); | |
76 | u64 btrfs_file_read(const struct btrfs_root *, u64, u64, u64, char *); | |
77 | ||
78 | /* subvolume.c */ | |
79 | u64 btrfs_get_default_subvol_objectid(void); | |
80 | ||
81 | /* extent-io.c */ | |
82 | u64 btrfs_read_extent_inline(struct btrfs_path *, | |
83 | struct btrfs_file_extent_item *, u64, u64, | |
84 | char *); | |
85 | u64 btrfs_read_extent_reg(struct btrfs_path *, struct btrfs_file_extent_item *, | |
86 | u64, u64, char *); | |
87 | ||
88 | #endif /* !__BTRFS_BTRFS_H__ */ |