From bcdb7058aad46c6e476d72991839065b2fcaa54d Mon Sep 17 00:00:00 2001 From: David Sterba Date: Mon, 31 Oct 2016 10:59:08 +0100 Subject: [PATCH] btrfs-progs: use symbolic tree name when searching Signed-off-by: David Sterba --- btrfs-fragments.c | 2 +- btrfs-list.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/btrfs-fragments.c b/btrfs-fragments.c index eb75eb7a..46c78d2b 100644 --- a/btrfs-fragments.c +++ b/btrfs-fragments.c @@ -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; diff --git a/btrfs-list.c b/btrfs-list.c index eb65110a..89769bc1 100644 --- a/btrfs-list.c +++ b/btrfs-list.c @@ -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