diff options
author | Liu Bo <liubo2009@cn.fujitsu.com> | 2012-08-03 17:48:51 +0800 |
---|---|---|
committer | root <root@localhost.localdomain> | 2012-10-04 16:26:31 -0400 |
commit | a8975893cf107772a20502b3c5b849ee6cb12f49 (patch) | |
tree | 44376c0c6793b1273f1c6ab9a1cff24bddeae1e9 /btrfs-list.c | |
parent | 50dcf9a5b4963ff3fbaf77ac2044f01986422dc2 (diff) |
Btrfs-progs: search subvolumes with proper objectid
Btrfs's subvolume/snapshot is limited to
[BTRFS_FIRST_FREE_OBJECTID, BTRFS_LAST_FREE_OBJECTID], so just apply the range.
Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Diffstat (limited to 'btrfs-list.c')
-rw-r--r-- | btrfs-list.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/btrfs-list.c b/btrfs-list.c index c53d0164..ac6507a4 100644 --- a/btrfs-list.c +++ b/btrfs-list.c @@ -634,11 +634,13 @@ static int __list_subvol_search(int fd, struct root_lookup *root_lookup) sk->max_type = BTRFS_ROOT_BACKREF_KEY; sk->min_type = BTRFS_ROOT_BACKREF_KEY; + sk->min_objectid = BTRFS_FIRST_FREE_OBJECTID; + /* * set all the other params to the max, we'll take any objectid * and any trans */ - sk->max_objectid = (u64)-1; + sk->max_objectid = BTRFS_LAST_FREE_OBJECTID; sk->max_offset = (u64)-1; sk->max_transid = (u64)-1; @@ -690,7 +692,7 @@ static int __list_subvol_search(int fd, struct root_lookup *root_lookup) if (sk->min_type < BTRFS_ROOT_BACKREF_KEY) { sk->min_type = BTRFS_ROOT_BACKREF_KEY; sk->min_offset = 0; - } else if (sk->min_objectid < (u64)-1) { + } else if (sk->min_objectid < BTRFS_LAST_FREE_OBJECTID) { sk->min_objectid++; sk->min_type = BTRFS_ROOT_BACKREF_KEY; sk->min_offset = 0; |