- ret = ioctl(fd, BTRFS_IOC_SYNC);
- if (ret < 0) {
- error("sync ioctl failed on '%s': %s", path,
- strerror(errno));
- close_file_or_dir(fd, dirstream);
- goto out;
- }
+ err = btrfs_util_sync_fd(fd);
+ if (err)
+ warning("sync ioctl failed on '%s': %s", path,
+ strerror(errno));