summaryrefslogtreecommitdiff
path: root/btrfs-list.c
diff options
context:
space:
mode:
Diffstat (limited to 'btrfs-list.c')
-rw-r--r--btrfs-list.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/btrfs-list.c b/btrfs-list.c
index b6d76585..e01c5899 100644
--- a/btrfs-list.c
+++ b/btrfs-list.c
@@ -644,8 +644,8 @@ static int lookup_ino_path(int fd, struct root_info *ri)
ri->ref_tree = 0;
return -ENOENT;
}
- error("failed to lookup path for root %llu: %s",
- (unsigned long long)ri->ref_tree, strerror(errno));
+ error("failed to lookup path for root %llu: %m",
+ (unsigned long long)ri->ref_tree);
return ret;
}
@@ -695,9 +695,8 @@ static u64 find_root_gen(int fd)
/* this ioctl fills in ino_args->treeid */
ret = ioctl(fd, BTRFS_IOC_INO_LOOKUP, &ino_args);
if (ret < 0) {
- error("failed to lookup path for dirid %llu: %s",
- (unsigned long long)BTRFS_FIRST_FREE_OBJECTID,
- strerror(errno));
+ error("failed to lookup path for dirid %llu: %m",
+ (unsigned long long)BTRFS_FIRST_FREE_OBJECTID);
return 0;
}
@@ -721,7 +720,7 @@ static u64 find_root_gen(int fd)
while (1) {
ret = ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args);
if (ret < 0) {
- error("can't perform the search: %s", strerror(errno));
+ error("can't perform the search: %m");
return 0;
}
/* the ioctl returns the number of item it found in nr_items */
@@ -781,8 +780,8 @@ static char *__ino_resolve(int fd, u64 dirid)
ret = ioctl(fd, BTRFS_IOC_INO_LOOKUP, &args);
if (ret < 0) {
- error("failed to lookup path for dirid %llu: %s",
- (unsigned long long)dirid, strerror(errno));
+ error("failed to lookup path for dirid %llu: %m",
+ (unsigned long long)dirid);
return ERR_PTR(ret);
}
@@ -860,7 +859,7 @@ static char *ino_resolve(int fd, u64 ino, u64 *cache_dirid, char **cache_name)
ret = ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args);
if (ret < 0) {
- error("can't perform the search: %s", strerror(errno));
+ error("can't perform the search: %m");
return NULL;
}
/* the ioctl returns the number of item it found in nr_items */
@@ -1496,7 +1495,7 @@ static int btrfs_list_subvols(int fd, struct root_lookup *root_lookup)
ret = list_subvol_search(fd, root_lookup);
if (ret) {
- error("can't perform the search: %s", strerror(errno));
+ error("can't perform the search: %m");
return ret;
}
@@ -1732,7 +1731,7 @@ int btrfs_list_find_updated_files(int fd, u64 root_id, u64 oldest_gen)
while(1) {
ret = ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args);
if (ret < 0) {
- error("can't perform the search: %s", strerror(errno));
+ error("can't perform the search: %m");
break;
}
/* the ioctl returns the number of item it found in nr_items */
@@ -1926,8 +1925,7 @@ int btrfs_list_get_path_rootid(int fd, u64 *treeid)
ret = lookup_path_rootid(fd, treeid);
if (ret < 0)
- error("cannot resolve rootid for path: %s",
- strerror(errno));
+ error("cannot resolve rootid for path: %m");
return ret;
}