diff options
author | Josef Bacik <jbacik@fb.com> | 2014-10-10 16:57:07 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2014-10-14 10:39:38 +0200 |
commit | d90d8d2323cdee2bdb3b130236c801ceeb8ea875 (patch) | |
tree | 7ad61eb1363ee1c6c940c55accf54ebac37662f1 /ctree.h | |
parent | 6863bcf74fa8bf335d73c04248fc25ac6ada3121 (diff) | |
download | btrfs-progs-d90d8d2323cdee2bdb3b130236c801ceeb8ea875.tar.gz |
Btrfs-progs: pull back backref.c and fix it up
This patch pulls back backref.c, adds a couple of helpers everywhere that it
needs, and cleans up backref.c to fit in btrfs-progs. Thanks,
Signed-off-by: Josef Bacik <jbacik@fb.com>
[removed free_some_buffers after "do not reclaim extent buffer"]
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'ctree.h')
-rw-r--r-- | ctree.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -2253,6 +2253,8 @@ struct extent_buffer *read_node_slot(struct btrfs_root *root, 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_cow_block(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct extent_buffer *buf, struct extent_buffer *parent, int parent_slot, @@ -2281,6 +2283,9 @@ int btrfs_split_item(struct btrfs_trans_handle *trans, int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_key *key, struct btrfs_path *p, int ins_len, int cow); +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); @@ -2313,6 +2318,15 @@ static inline int btrfs_insert_empty_item(struct btrfs_trans_handle *trans, } int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *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])) + return btrfs_next_leaf(root, p); + return 0; +} + int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path); int btrfs_leaf_free_space(struct btrfs_root *root, struct extent_buffer *leaf); void btrfs_fixup_low_keys(struct btrfs_root *root, struct btrfs_path *path, |