diff options
author | David Sterba <dsterba@suse.com> | 2016-10-31 10:38:31 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-11-09 13:47:28 +0100 |
commit | 1c85c3de5aab997ff66ea95cb0f2c9f79726ec40 (patch) | |
tree | 48089000f1128679f762ab9f5e9b9a5f91835718 /btrfs-list.c | |
parent | 49cb98e5d6989055860eee06879c10896489062f (diff) |
btrfs-progs: use existing rootid resolving helper in btrfs_list_get_path_rootid
The utils helper is not verbose in case of an error, for now the helper
used for subvolume listing will print the error message but not
duplicate the ioctl anymore.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'btrfs-list.c')
-rw-r--r-- | btrfs-list.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/btrfs-list.c b/btrfs-list.c index b5d4458b..831b13d3 100644 --- a/btrfs-list.c +++ b/btrfs-list.c @@ -1888,19 +1888,12 @@ int btrfs_list_parse_filter_string(char *opt_arg, int btrfs_list_get_path_rootid(int fd, u64 *treeid) { - int ret; - struct btrfs_ioctl_ino_lookup_args args; - - memset(&args, 0, sizeof(args)); - args.objectid = BTRFS_FIRST_FREE_OBJECTID; + int ret; - ret = ioctl(fd, BTRFS_IOC_INO_LOOKUP, &args); - if (ret < 0) { - fprintf(stderr, - "ERROR: can't perform the search - %s\n", + ret = lookup_path_rootid(fd, treeid); + if (ret < 0) + error("cannot resolve rootid for path: %s", strerror(errno)); - return ret; - } - *treeid = args.treeid; - return 0; + + return ret; } |