summaryrefslogtreecommitdiff
path: root/cmds-qgroup.c
diff options
context:
space:
mode:
authorOmar Sandoval <osandov@fb.com>2018-01-25 01:35:27 -0800
committerDavid Sterba <dsterba@suse.com>2018-03-06 11:28:37 +0100
commitec7251486ddf509ee1c73a75e6468d8a36f9a049 (patch)
treec8a9b749fc3f817d0f534a85a5a72ed8e877ab57 /cmds-qgroup.c
parent3e76e9b67610e179bac4688c76002ff1adb338d4 (diff)
btrfs-progs: use libbtrfsutil for sync ioctls
Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-qgroup.c')
-rw-r--r--cmds-qgroup.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/cmds-qgroup.c b/cmds-qgroup.c
index 48686436..2499a280 100644
--- a/cmds-qgroup.c
+++ b/cmds-qgroup.c
@@ -20,6 +20,8 @@
#include <unistd.h>
#include <getopt.h>
+#include <btrfsutil.h>
+
#include "ctree.h"
#include "ioctl.h"
@@ -299,6 +301,7 @@ static int cmd_qgroup_show(int argc, char **argv)
int filter_flag = 0;
unsigned unit_mode;
int sync = 0;
+ enum btrfs_util_error err;
struct btrfs_qgroup_comparer_set *comparer_set;
struct btrfs_qgroup_filter_set *filter_set;
@@ -372,9 +375,10 @@ static int cmd_qgroup_show(int argc, char **argv)
}
if (sync) {
- ret = ioctl(fd, BTRFS_IOC_SYNC);
- if (ret < 0)
- warning("sync ioctl failed on '%s': %m", path);
+ err = btrfs_util_sync_fd(fd);
+ if (err)
+ warning("sync ioctl failed on '%s': %s", path,
+ strerror(errno));
}
if (filter_flag) {