2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2017-09-03 15:00:28 +00:00
|
|
|
/*
|
|
|
|
* BTRFS filesystem implementation for U-Boot
|
|
|
|
*
|
|
|
|
* 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __BTRFS_BTRFS_H__
|
|
|
|
#define __BTRFS_BTRFS_H__
|
|
|
|
|
|
|
|
#include <linux/rbtree.h>
|
|
|
|
#include "conv-funcs.h"
|
|
|
|
|
|
|
|
struct btrfs_info {
|
|
|
|
struct btrfs_super_block sb;
|
|
|
|
|
2020-06-24 16:02:57 +00:00
|
|
|
struct __btrfs_root tree_root;
|
|
|
|
struct __btrfs_root fs_root;
|
|
|
|
struct __btrfs_root chunk_root;
|
2017-09-03 15:00:28 +00:00
|
|
|
|
|
|
|
struct rb_root chunks_root;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct btrfs_info btrfs_info;
|
|
|
|
|
|
|
|
/* dev.c */
|
|
|
|
extern struct blk_desc *btrfs_blk_desc;
|
2020-05-10 17:39:57 +00:00
|
|
|
extern struct disk_partition *btrfs_part_info;
|
2017-09-03 15:00:28 +00:00
|
|
|
|
|
|
|
int btrfs_devread(u64, int, void *);
|
|
|
|
|
|
|
|
/* chunk-map.c */
|
|
|
|
u64 btrfs_map_logical_to_physical(u64);
|
|
|
|
int btrfs_chunk_map_init(void);
|
|
|
|
void btrfs_chunk_map_exit(void);
|
2020-06-24 16:03:00 +00:00
|
|
|
int __btrfs_read_chunk_tree(void);
|
2017-09-03 15:00:28 +00:00
|
|
|
|
|
|
|
/* compression.c */
|
|
|
|
u32 btrfs_decompress(u8 type, const char *, u32, char *, u32);
|
|
|
|
|
|
|
|
/* super.c */
|
|
|
|
int btrfs_read_superblock(void);
|
|
|
|
|
|
|
|
/* dir-item.c */
|
2020-06-24 16:02:57 +00:00
|
|
|
typedef int (*btrfs_readdir_callback_t)(const struct __btrfs_root *,
|
2017-09-03 15:00:28 +00:00
|
|
|
struct btrfs_dir_item *);
|
|
|
|
|
2020-06-24 16:02:57 +00:00
|
|
|
int btrfs_lookup_dir_item(const struct __btrfs_root *, u64, const char *, int,
|
2017-09-03 15:00:28 +00:00
|
|
|
struct btrfs_dir_item *);
|
2020-06-24 16:02:57 +00:00
|
|
|
int btrfs_readdir(const struct __btrfs_root *, u64, btrfs_readdir_callback_t);
|
2017-09-03 15:00:28 +00:00
|
|
|
|
|
|
|
/* root.c */
|
2020-06-24 16:02:57 +00:00
|
|
|
int btrfs_find_root(u64, struct __btrfs_root *, struct btrfs_root_item *);
|
2017-09-03 15:00:28 +00:00
|
|
|
u64 btrfs_lookup_root_ref(u64, struct btrfs_root_ref *, char *);
|
|
|
|
|
|
|
|
/* inode.c */
|
2020-06-24 16:02:57 +00:00
|
|
|
u64 btrfs_lookup_inode_ref(struct __btrfs_root *, u64, struct btrfs_inode_ref *,
|
2017-09-03 15:00:28 +00:00
|
|
|
char *);
|
2020-06-24 16:02:57 +00:00
|
|
|
int btrfs_lookup_inode(const struct __btrfs_root *, struct btrfs_key *,
|
|
|
|
struct btrfs_inode_item *, struct __btrfs_root *);
|
|
|
|
int btrfs_readlink(const struct __btrfs_root *, u64, char *);
|
|
|
|
u64 btrfs_lookup_path(struct __btrfs_root *, u64, const char *, u8 *,
|
2017-09-03 15:00:28 +00:00
|
|
|
struct btrfs_inode_item *, int);
|
2020-06-24 16:02:57 +00:00
|
|
|
u64 btrfs_file_read(const struct __btrfs_root *, u64, u64, u64, char *);
|
2017-09-03 15:00:28 +00:00
|
|
|
|
|
|
|
/* subvolume.c */
|
|
|
|
u64 btrfs_get_default_subvol_objectid(void);
|
|
|
|
|
|
|
|
/* extent-io.c */
|
2020-06-24 16:02:56 +00:00
|
|
|
u64 btrfs_read_extent_inline(struct __btrfs_path *,
|
2017-09-03 15:00:28 +00:00
|
|
|
struct btrfs_file_extent_item *, u64, u64,
|
|
|
|
char *);
|
2020-06-24 16:02:56 +00:00
|
|
|
u64 btrfs_read_extent_reg(struct __btrfs_path *, struct btrfs_file_extent_item *,
|
2017-09-03 15:00:28 +00:00
|
|
|
u64, u64, char *);
|
|
|
|
|
|
|
|
#endif /* !__BTRFS_BTRFS_H__ */
|