diff options
author | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2011-11-22 09:14:33 -0500 |
---|---|---|
committer | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2011-12-22 10:22:26 -0500 |
commit | c7d22a3c3cdb73d8a0151e2ccc8cf4a48c48310b (patch) | |
tree | 5145d5913cb27adc041cff323842f51e861327f5 /fs/btrfs/ctree.h | |
parent | da5c81356426c476112f2b59fe64bdb1b37f079d (diff) |
Btrfs: added helper btrfs_next_item()
btrfs_next_item() makes the btrfs path point to the next item, crossing leaf
boundaries if needed.
Signed-off-by: Arne Jansen <sensille@gmx.net>
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 50634abef9b4..3e4a07b79817 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -2482,6 +2482,13 @@ static inline int btrfs_insert_empty_item(struct btrfs_trans_handle *trans, | |||
2482 | } | 2482 | } |
2483 | 2483 | ||
2484 | int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path); | 2484 | int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path); |
2485 | static inline int btrfs_next_item(struct btrfs_root *root, struct btrfs_path *p) | ||
2486 | { | ||
2487 | ++p->slots[0]; | ||
2488 | if (p->slots[0] >= btrfs_header_nritems(p->nodes[0])) | ||
2489 | return btrfs_next_leaf(root, p); | ||
2490 | return 0; | ||
2491 | } | ||
2485 | int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path); | 2492 | int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path); |
2486 | int btrfs_leaf_free_space(struct btrfs_root *root, struct extent_buffer *leaf); | 2493 | int btrfs_leaf_free_space(struct btrfs_root *root, struct extent_buffer *leaf); |
2487 | void btrfs_drop_snapshot(struct btrfs_root *root, | 2494 | void btrfs_drop_snapshot(struct btrfs_root *root, |