btrfs-progs: subvol list: remove useless comments
The search ioctl follows a well known usage pattern. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
f52b559873
commit
37bc144172
19
btrfs-list.c
19
btrfs-list.c
|
@ -979,32 +979,21 @@ static int list_subvol_search(int fd, struct root_lookup *root_lookup)
|
|||
memset(&args, 0, sizeof(args));
|
||||
|
||||
sk->tree_id = BTRFS_ROOT_TREE_OBJECTID;
|
||||
|
||||
/*
|
||||
* set the min and max to backref keys. The search will
|
||||
* only send back this type of key now.
|
||||
*/
|
||||
/* Search both live and deleted subvolumes */
|
||||
sk->max_type = BTRFS_ROOT_BACKREF_KEY;
|
||||
sk->min_type = BTRFS_ROOT_ITEM_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 = BTRFS_LAST_FREE_OBJECTID;
|
||||
sk->max_offset = (u64)-1;
|
||||
sk->max_transid = (u64)-1;
|
||||
|
||||
/* just a big number, doesn't matter much */
|
||||
sk->nr_items = 4096;
|
||||
|
||||
while(1) {
|
||||
ret = ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
/* the ioctl returns the number of item it found in nr_items */
|
||||
if (sk->nr_items == 0)
|
||||
break;
|
||||
|
||||
|
@ -1052,17 +1041,13 @@ static int list_subvol_search(int fd, struct root_lookup *root_lookup)
|
|||
|
||||
off += sh.len;
|
||||
|
||||
/*
|
||||
* record the mins in sk so we can make sure the
|
||||
* next search doesn't repeat this root
|
||||
*/
|
||||
sk->min_objectid = sh.objectid;
|
||||
sk->min_type = sh.type;
|
||||
sk->min_offset = sh.offset;
|
||||
}
|
||||
sk->nr_items = 4096;
|
||||
sk->min_offset++;
|
||||
if (!sk->min_offset) /* overflow */
|
||||
if (!sk->min_offset)
|
||||
sk->min_type++;
|
||||
else
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue