mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-27 21:47:56 +00:00
btrfs-progs: libbtrfs: reduce exports from ctree.h
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
0631817e6f
commit
84062449f2
322
libbtrfs/ctree.h
322
libbtrfs/ctree.h
@ -2653,149 +2653,6 @@ static inline int __btrfs_fs_compat_ro(struct btrfs_fs_info *fs_info, u64 flag)
|
||||
((unsigned long)(btrfs_leaf_data(leaf) + \
|
||||
btrfs_item_offset(leaf, slot)))
|
||||
|
||||
u64 btrfs_name_hash(const char *name, int len);
|
||||
u64 btrfs_extref_hash(u64 parent_objectid, const char *name, int len);
|
||||
|
||||
/* extent-tree.c */
|
||||
int btrfs_reserve_extent(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
u64 num_bytes, u64 empty_size,
|
||||
u64 hint_byte, u64 search_end,
|
||||
struct btrfs_key *ins, bool is_data);
|
||||
int btrfs_fix_block_accounting(struct btrfs_trans_handle *trans);
|
||||
void btrfs_pin_extent(struct btrfs_fs_info *fs_info, u64 bytenr, u64 num_bytes);
|
||||
void btrfs_unpin_extent(struct btrfs_fs_info *fs_info,
|
||||
u64 bytenr, u64 num_bytes);
|
||||
struct btrfs_block_group *btrfs_lookup_block_group(struct btrfs_fs_info *info,
|
||||
u64 bytenr);
|
||||
struct btrfs_block_group *btrfs_lookup_first_block_group(struct
|
||||
btrfs_fs_info *info,
|
||||
u64 bytenr);
|
||||
struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
u32 blocksize, u64 root_objectid,
|
||||
struct btrfs_disk_key *key, int level,
|
||||
u64 hint, u64 empty_size);
|
||||
int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_fs_info *fs_info, u64 bytenr,
|
||||
u64 offset, int metadata, u64 *refs, u64 *flags);
|
||||
int btrfs_set_block_flags(struct btrfs_trans_handle *trans, u64 bytenr,
|
||||
int level, u64 flags);
|
||||
int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
|
||||
struct extent_buffer *buf, int record_parent);
|
||||
int btrfs_dec_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
|
||||
struct extent_buffer *buf, int record_parent);
|
||||
int btrfs_free_tree_block(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
struct extent_buffer *buf,
|
||||
u64 parent, int last_ref);
|
||||
int btrfs_free_extent(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
u64 bytenr, u64 num_bytes, u64 parent,
|
||||
u64 root_objectid, u64 owner, u64 offset);
|
||||
void btrfs_finish_extent_commit(struct btrfs_trans_handle *trans);
|
||||
int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
u64 bytenr, u64 num_bytes, u64 parent,
|
||||
u64 root_objectid, u64 owner, u64 offset);
|
||||
int btrfs_update_extent_ref(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root, u64 bytenr,
|
||||
u64 orig_parent, u64 parent,
|
||||
u64 root_objectid, u64 ref_generation,
|
||||
u64 owner_objectid);
|
||||
int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans);
|
||||
int update_space_info(struct btrfs_fs_info *info, u64 flags,
|
||||
u64 total_bytes, u64 bytes_used,
|
||||
struct btrfs_space_info **space_info);
|
||||
int btrfs_free_block_groups(struct btrfs_fs_info *info);
|
||||
int btrfs_read_block_groups(struct btrfs_fs_info *info);
|
||||
struct btrfs_block_group *
|
||||
btrfs_add_block_group(struct btrfs_fs_info *fs_info, u64 bytes_used, u64 type,
|
||||
u64 chunk_offset, u64 size);
|
||||
int btrfs_make_block_group(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_fs_info *fs_info, u64 bytes_used,
|
||||
u64 type, u64 chunk_offset, u64 size);
|
||||
int btrfs_make_block_groups(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_fs_info *fs_info);
|
||||
int btrfs_update_block_group(struct btrfs_trans_handle *trans, u64 bytenr,
|
||||
u64 num, int alloc, int mark_free);
|
||||
int btrfs_record_file_extent(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root, u64 objectid,
|
||||
struct btrfs_inode_item *inode,
|
||||
u64 file_pos, u64 disk_bytenr,
|
||||
u64 num_bytes);
|
||||
int btrfs_remove_block_group(struct btrfs_trans_handle *trans,
|
||||
u64 bytenr, u64 len);
|
||||
void free_excluded_extents(struct btrfs_fs_info *fs_info,
|
||||
struct btrfs_block_group *cache);
|
||||
int exclude_super_stripes(struct btrfs_fs_info *fs_info,
|
||||
struct btrfs_block_group *cache);
|
||||
u64 add_new_free_space(struct btrfs_block_group *block_group,
|
||||
struct btrfs_fs_info *info, u64 start, u64 end);
|
||||
u64 hash_extent_data_ref(u64 root_objectid, u64 owner, u64 offset);
|
||||
|
||||
/* ctree.c */
|
||||
int btrfs_comp_cpu_keys(const struct btrfs_key *k1, const struct btrfs_key *k2);
|
||||
int btrfs_del_ptr(struct btrfs_root *root, struct btrfs_path *path,
|
||||
int level, int slot);
|
||||
enum btrfs_tree_block_status
|
||||
btrfs_check_node(struct btrfs_fs_info *fs_info,
|
||||
struct btrfs_key *parent_key, struct extent_buffer *buf);
|
||||
enum btrfs_tree_block_status
|
||||
btrfs_check_leaf(struct btrfs_fs_info *fs_info,
|
||||
struct btrfs_key *parent_key, struct extent_buffer *buf);
|
||||
void reada_for_search(struct btrfs_fs_info *fs_info, struct btrfs_path *path,
|
||||
int level, int slot, u64 objectid);
|
||||
struct extent_buffer *read_node_slot(struct btrfs_fs_info *fs_info,
|
||||
struct extent_buffer *parent, int slot);
|
||||
int btrfs_previous_item(struct btrfs_root *root,
|
||||
struct btrfs_path *path, u64 min_objectid,
|
||||
int type);
|
||||
int btrfs_previous_extent_item(struct btrfs_root *root,
|
||||
struct btrfs_path *path, u64 min_objectid);
|
||||
int btrfs_next_extent_item(struct btrfs_root *root,
|
||||
struct btrfs_path *path, u64 max_objectid);
|
||||
int btrfs_cow_block(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root, struct extent_buffer *buf,
|
||||
struct extent_buffer *parent, int parent_slot,
|
||||
struct extent_buffer **cow_ret);
|
||||
int __btrfs_cow_block(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
struct extent_buffer *buf,
|
||||
struct extent_buffer *parent, int parent_slot,
|
||||
struct extent_buffer **cow_ret,
|
||||
u64 search_start, u64 empty_size);
|
||||
int btrfs_copy_root(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
struct extent_buffer *buf,
|
||||
struct extent_buffer **cow_ret, u64 new_root_objectid);
|
||||
int btrfs_create_root(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_fs_info *fs_info, u64 objectid);
|
||||
int btrfs_extend_item(struct btrfs_root *root, struct btrfs_path *path,
|
||||
u32 data_size);
|
||||
int btrfs_truncate_item(struct btrfs_path *path, u32 new_size, int from_end);
|
||||
int btrfs_split_item(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
struct btrfs_path *path,
|
||||
struct btrfs_key *new_key,
|
||||
unsigned long split_offset);
|
||||
int btrfs_search_slot(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root, const struct btrfs_key *key,
|
||||
struct btrfs_path *p, int ins_len, int cow);
|
||||
int btrfs_search_slot_for_read(struct btrfs_root *root,
|
||||
const struct btrfs_key *key,
|
||||
struct btrfs_path *p, int find_higher,
|
||||
int return_any);
|
||||
int btrfs_bin_search(struct extent_buffer *eb, const struct btrfs_key *key,
|
||||
int *slot);
|
||||
int btrfs_find_item(struct btrfs_root *fs_root, struct btrfs_path *found_path,
|
||||
u64 iobjectid, u64 ioff, u8 key_type,
|
||||
struct btrfs_key *found_key);
|
||||
void btrfs_release_path(struct btrfs_path *p);
|
||||
void add_root_to_dirty_list(struct btrfs_root *root);
|
||||
struct btrfs_path *btrfs_alloc_path(void);
|
||||
void btrfs_free_path(struct btrfs_path *p);
|
||||
void btrfs_init_path(struct btrfs_path *p);
|
||||
int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
|
||||
struct btrfs_path *path, int slot, int nr);
|
||||
|
||||
@ -2838,183 +2695,4 @@ static inline int btrfs_next_leaf(struct btrfs_root *root,
|
||||
return btrfs_next_sibling_tree_block(root->fs_info, path);
|
||||
}
|
||||
|
||||
static inline int btrfs_next_item(struct btrfs_root *root,
|
||||
struct btrfs_path *p)
|
||||
{
|
||||
++p->slots[0];
|
||||
if (p->slots[0] >= btrfs_header_nritems(p->nodes[0])) {
|
||||
int ret;
|
||||
ret = btrfs_next_leaf(root, p);
|
||||
/*
|
||||
* Revert the increased slot, or the path may point to
|
||||
* an invalid item.
|
||||
*/
|
||||
if (ret)
|
||||
p->slots[0]--;
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path);
|
||||
int btrfs_leaf_free_space(struct extent_buffer *leaf);
|
||||
void btrfs_fixup_low_keys(struct btrfs_path *path, struct btrfs_disk_key *key,
|
||||
int level);
|
||||
int btrfs_set_item_key_safe(struct btrfs_root *root, struct btrfs_path *path,
|
||||
struct btrfs_key *new_key);
|
||||
void btrfs_set_item_key_unsafe(struct btrfs_root *root,
|
||||
struct btrfs_path *path,
|
||||
struct btrfs_key *new_key);
|
||||
|
||||
u16 btrfs_super_csum_size(const struct btrfs_super_block *s);
|
||||
const char *btrfs_super_csum_name(u16 csum_type);
|
||||
u16 btrfs_csum_type_size(u16 csum_type);
|
||||
size_t btrfs_super_num_csums(void);
|
||||
|
||||
/* root-item.c */
|
||||
int btrfs_add_root_ref(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *tree_root,
|
||||
u64 root_id, u8 type, u64 ref_id,
|
||||
u64 dirid, u64 sequence,
|
||||
const char *name, int name_len);
|
||||
int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root
|
||||
*root, struct btrfs_key *key, struct btrfs_root_item
|
||||
*item);
|
||||
int btrfs_del_root(struct btrfs_trans_handle *trans, struct btrfs_root *root,
|
||||
struct btrfs_key *key);
|
||||
int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root
|
||||
*root, struct btrfs_key *key, struct btrfs_root_item
|
||||
*item);
|
||||
int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, struct
|
||||
btrfs_root_item *item, struct btrfs_key *key);
|
||||
/* dir-item.c */
|
||||
int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root
|
||||
*root, const char *name, int name_len, u64 dir,
|
||||
struct btrfs_key *location, u8 type, u64 index);
|
||||
struct btrfs_dir_item *btrfs_lookup_dir_item(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
struct btrfs_path *path, u64 dir,
|
||||
const char *name, int name_len,
|
||||
int mod);
|
||||
struct btrfs_dir_item *btrfs_lookup_dir_index_item(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
struct btrfs_path *path, u64 dir,
|
||||
u64 objectid, const char *name, int name_len,
|
||||
int mod);
|
||||
int btrfs_delete_one_dir_name(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
struct btrfs_path *path,
|
||||
struct btrfs_dir_item *di);
|
||||
int btrfs_insert_xattr_item(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root, const char *name,
|
||||
u16 name_len, const void *data, u16 data_len,
|
||||
u64 dir);
|
||||
struct btrfs_dir_item *btrfs_match_dir_item_name(struct btrfs_root *root,
|
||||
struct btrfs_path *path,
|
||||
const char *name, int name_len);
|
||||
|
||||
/* inode-item.c */
|
||||
int btrfs_insert_inode_ref(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
const char *name, int name_len,
|
||||
u64 inode_objectid, u64 ref_objectid, u64 index);
|
||||
int btrfs_insert_inode(struct btrfs_trans_handle *trans, struct btrfs_root
|
||||
*root, u64 objectid, struct btrfs_inode_item
|
||||
*inode_item);
|
||||
int btrfs_lookup_inode(struct btrfs_trans_handle *trans, struct btrfs_root
|
||||
*root, struct btrfs_path *path,
|
||||
struct btrfs_key *location, int mod);
|
||||
struct btrfs_inode_extref *btrfs_lookup_inode_extref(struct btrfs_trans_handle
|
||||
*trans, struct btrfs_path *path, struct btrfs_root *root,
|
||||
u64 ino, u64 parent_ino, u64 index, const char *name,
|
||||
int namelen, int ins_len);
|
||||
int btrfs_del_inode_extref(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
const char *name, int name_len,
|
||||
u64 inode_objectid, u64 ref_objectid,
|
||||
u64 *index);
|
||||
int btrfs_insert_inode_extref(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
const char *name, int name_len,
|
||||
u64 inode_objectid, u64 ref_objectid, u64 index);
|
||||
struct btrfs_inode_ref *btrfs_lookup_inode_ref(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root, struct btrfs_path *path,
|
||||
const char *name, int namelen, u64 ino, u64 parent_ino,
|
||||
int ins_len);
|
||||
int btrfs_del_inode_ref(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root, const char *name, int name_len,
|
||||
u64 ino, u64 parent_ino, u64 *index);
|
||||
|
||||
/* file-item.c */
|
||||
int btrfs_del_csums(struct btrfs_trans_handle *trans, u64 bytenr, u64 len);
|
||||
int btrfs_insert_file_extent(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
u64 objectid, u64 pos, u64 offset,
|
||||
u64 disk_num_bytes,
|
||||
u64 num_bytes);
|
||||
int btrfs_insert_inline_extent(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root, u64 objectid,
|
||||
u64 offset, const char *buffer, size_t size);
|
||||
int btrfs_csum_file_block(struct btrfs_trans_handle *trans, u64 alloc_end,
|
||||
u64 bytenr, char *data, size_t len);
|
||||
|
||||
/* uuid-tree.c, interface for mounted mounted filesystem */
|
||||
int btrfs_lookup_uuid_subvol_item(int fd, const u8 *uuid, u64 *subvol_id);
|
||||
int btrfs_lookup_uuid_received_subvol_item(int fd, const u8 *uuid,
|
||||
u64 *subvol_id);
|
||||
|
||||
/* uuid-tree.c, interface for unmounte filesystem */
|
||||
int btrfs_uuid_tree_add(struct btrfs_trans_handle *trans, u8 *uuid, u8 type,
|
||||
u64 subvol_id_cpu);
|
||||
int btrfs_uuid_tree_remove(struct btrfs_trans_handle *trans, u8 *uuid, u8 type,
|
||||
u64 subid);
|
||||
|
||||
static inline int is_fstree(u64 rootid)
|
||||
{
|
||||
if (rootid == BTRFS_FS_TREE_OBJECTID ||
|
||||
(signed long long)rootid >= (signed long long)BTRFS_FIRST_FREE_OBJECTID)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void btrfs_uuid_to_key(const u8 *uuid, struct btrfs_key *key);
|
||||
|
||||
/* inode.c */
|
||||
int check_dir_conflict(struct btrfs_root *root, char *name, int namelen,
|
||||
u64 dir, u64 index);
|
||||
int btrfs_new_inode(struct btrfs_trans_handle *trans, struct btrfs_root *root,
|
||||
u64 ino, u32 mode);
|
||||
int btrfs_change_inode_flags(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root, u64 ino, u64 flags);
|
||||
int btrfs_add_link(struct btrfs_trans_handle *trans, struct btrfs_root *root,
|
||||
u64 ino, u64 parent_ino, char *name, int namelen,
|
||||
u8 type, u64 *index, int add_backref, int ignore_existed);
|
||||
int btrfs_unlink(struct btrfs_trans_handle *trans, struct btrfs_root *root,
|
||||
u64 ino, u64 parent_ino, u64 index, const char *name,
|
||||
int namelen, int add_orphan);
|
||||
int btrfs_add_orphan_item(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root, struct btrfs_path *path,
|
||||
u64 ino);
|
||||
int btrfs_mkdir(struct btrfs_trans_handle *trans, struct btrfs_root *root,
|
||||
char *name, int namelen, u64 parent_ino, u64 *ino, int mode);
|
||||
struct btrfs_root *btrfs_mksubvol(struct btrfs_root *root, const char *base,
|
||||
u64 root_objectid, bool convert);
|
||||
int btrfs_find_free_objectid(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *fs_root,
|
||||
u64 dirid, u64 *objectid);
|
||||
|
||||
/* file.c */
|
||||
int btrfs_get_extent(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
struct btrfs_path *path,
|
||||
u64 ino, u64 offset, u64 len, int ins_len);
|
||||
int btrfs_punch_hole(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root,
|
||||
u64 ino, u64 offset, u64 len);
|
||||
int btrfs_read_file(struct btrfs_root *root, u64 ino, u64 start, int len,
|
||||
char *dest);
|
||||
|
||||
/* extent-tree.c */
|
||||
int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, unsigned long nr);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user