aboutsummaryrefslogtreecommitdiffstats
path: root/volumes.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2015-11-13 10:53:41 +0800
committerDavid Sterba <dsterba@suse.com>2015-11-16 14:23:45 +0100
commit214308422933601138ee484e81dade47edcb442c (patch)
tree5dbdc5138a81dd7f1067d57180bae246ff762bbf /volumes.c
parent0ca4cd99a50cfe942701fa915f34b6543a89bc98 (diff)
downloadbtrfs-progs-214308422933601138ee484e81dade47edcb442c.tar.gz
btrfs-progs-214308422933601138ee484e81dade47edcb442c.tar.xz
btrfs-progs-214308422933601138ee484e81dade47edcb442c.zip
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 <quwenruo@cn.fujitsu.com> [ renamed to btrfs_next_bg_* ] Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'volumes.c')
-rw-r--r--volumes.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/volumes.c b/volumes.c
index 00f3edf..4e683bb 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;