try
{
+#ifdef HAVE_LIBBTRFS
subvolid_t subvolid = get_id(openSnapshotDir(num).fd());
+#endif
delete_subvolume(info_dir.fd(), "snapshot");
+#ifdef HAVE_LIBBTRFS
deleted_subvolids.push_back(subvolid);
+#endif
}
catch (const runtime_error& e)
{
{
for (subvolid_t subvolid : deleted_subvolids)
{
+#ifdef HAVE_LIBBTRFS
while (!does_subvolume_exist(subvolume_dir.fd(), subvolid))
sleep(1);
+#endif
}
deleted_subvolids.clear();
#define BTRFS_IOC_SUBVOL_CREATE _IOW(BTRFS_IOCTL_MAGIC, 14, struct btrfs_ioctl_vol_args)
#define BTRFS_IOC_SNAP_DESTROY _IOW(BTRFS_IOCTL_MAGIC, 15, struct btrfs_ioctl_vol_args)
#define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, struct btrfs_ioctl_vol_args_v2)
+#define BTRFS_IOC_SYNC _IO(BTRFS_IOCTL_MAGIC, 8)
struct btrfs_ioctl_vol_args
{
#endif
+#ifdef HAVE_LIBBTRFS
+
subvolid_t
get_id(int fd)
{
return args.treeid;
}
+#endif
+
qgroup_t
make_qgroup(uint64_t level, subvolid_t id)
}
+#ifdef HAVE_LIBBTRFS
+
bool
does_subvolume_exist(int fd, subvolid_t subvolid)
{
return sk->nr_items == 0;
}
+#endif
+
void
sync(int fd)