btrfs-progs: use symbolic tree name when searching

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2016-10-31 10:59:08 +01:00
parent 1fa9cc4991
commit bcdb7058aa
2 changed files with 4 additions and 5 deletions

View File

@ -218,7 +218,7 @@ list_fragments(int fd, u64 flags, char *dir)
memset(&args, 0, sizeof(args));
sk->tree_id = 2;
sk->tree_id = BTRFS_EXTENT_TREE_OBJECTID;
sk->max_type = -1;
sk->min_type = 0;
sk->max_objectid = (u64)-1;

View File

@ -698,7 +698,7 @@ static u64 find_root_gen(int fd)
memset(&args, 0, sizeof(args));
sk->tree_id = 1;
sk->tree_id = BTRFS_ROOT_TREE_OBJECTID;
/*
* there may be more than one ROOT_ITEM key if there are
@ -916,7 +916,7 @@ int btrfs_list_get_default_subvolume(int fd, u64 *default_id)
* search for a dir item with a name 'default' in the tree of
* tree roots, it should point us to a default root
*/
sk->tree_id = 1;
sk->tree_id = BTRFS_ROOT_TREE_OBJECTID;
/* don't worry about ancient format and request only one item */
sk->nr_items = 1;
@ -980,8 +980,7 @@ static int list_subvol_search(int fd, struct root_lookup *root_lookup)
root_lookup_init(root_lookup);
memset(&args, 0, sizeof(args));
/* search in the tree of tree roots */
sk->tree_id = 1;
sk->tree_id = BTRFS_ROOT_TREE_OBJECTID;
/*
* set the min and max to backref keys. The search will