diff options
author | Josef Bacik <josef@toxicpanda.com> | 2022-09-14 17:06:40 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-12-05 18:00:37 +0100 |
commit | 890d2b1aa38b9101503194855aeee897ba6cdbc2 (patch) | |
tree | 1c83e044b047892ae9714b73669e824a01940eca /fs/btrfs/ctree.c | |
parent | btrfs: move free space cachep's out of ctree.h (diff) | |
download | linux-890d2b1aa38b9101503194855aeee897ba6cdbc2.tar.xz linux-890d2b1aa38b9101503194855aeee897ba6cdbc2.zip |
btrfs: move btrfs_next_old_item into ctree.c
This uses btrfs_header_nritems, which I will be moving out of ctree.h.
In order to avoid needing to include the relevant header in ctree.h,
simply move this helper function into ctree.c.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ rename parameters ]
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 4f2d367e1207..5f461e05cc9c 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -4852,6 +4852,14 @@ done: return ret; } +int btrfs_next_old_item(struct btrfs_root *root, struct btrfs_path *path, u64 time_seq) +{ + path->slots[0]++; + if (path->slots[0] >= btrfs_header_nritems(path->nodes[0])) + return btrfs_next_old_leaf(root, path, time_seq); + return 0; +} + /* * this uses btrfs_prev_leaf to walk backwards in the tree, and keeps * searching until it gets past min_objectid or finds an item of 'type' |