From 214308422933601138ee484e81dade47edcb442c Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Fri, 13 Nov 2015 10:53:41 +0800 Subject: btrfs-progs: find-root: Add support to search chunk root Add support to search chunk root, as we only need to search tree roots in system chunk, which should be very easy to add, just iterate in system chunks. Signed-off-by: Qu Wenruo [ renamed to btrfs_next_bg_* ] Signed-off-by: David Sterba --- volumes.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'volumes.c') diff --git a/volumes.c b/volumes.c index 00f3edf1..4e683bbf 100644 --- a/volumes.c +++ b/volumes.c @@ -1165,8 +1165,8 @@ int btrfs_num_copies(struct btrfs_mapping_tree *map_tree, u64 logical, u64 len) return ret; } -int btrfs_next_metadata(struct btrfs_mapping_tree *map_tree, u64 *logical, - u64 *size) +int btrfs_next_bg(struct btrfs_mapping_tree *map_tree, u64 *logical, + u64 *size, u64 type) { struct cache_extent *ce; struct map_lookup *map; @@ -1179,7 +1179,7 @@ int btrfs_next_metadata(struct btrfs_mapping_tree *map_tree, u64 *logical, return -ENOENT; map = container_of(ce, struct map_lookup, ce); - if (map->type & BTRFS_BLOCK_GROUP_METADATA) { + if (map->type & type) { *logical = ce->start; *size = ce->size; return 0; -- cgit v1.2.3