summaryrefslogtreecommitdiff
path: root/volumes.h
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.h
parent0ca4cd99a50cfe942701fa915f34b6543a89bc98 (diff)
downloadbtrfs-progs-214308422933601138ee484e81dade47edcb442c.tar.gz
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.h')
-rw-r--r--volumes.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/volumes.h b/volumes.h
index 4ecb993..eb434f1 100644
--- a/volumes.h
+++ b/volumes.h
@@ -167,8 +167,20 @@ int btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw,
u64 logical, u64 *length,
struct btrfs_multi_bio **multi_ret, int mirror_num,
u64 **raid_map_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);
+static inline int btrfs_next_bg_metadata(struct btrfs_mapping_tree *map_tree,
+ u64 *logical, u64 *size)
+{
+ return btrfs_next_bg(map_tree, logical, size,
+ BTRFS_BLOCK_GROUP_METADATA);
+}
+static inline int btrfs_next_bg_system(struct btrfs_mapping_tree *map_tree,
+ u64 *logical, u64 *size)
+{
+ return btrfs_next_bg(map_tree, logical, size,
+ BTRFS_BLOCK_GROUP_SYSTEM);
+}
int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree,
u64 chunk_start, u64 physical, u64 devid,
u64 **logical, int *naddrs, int *stripe_len);