summaryrefslogtreecommitdiff
path: root/send-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'send-utils.h')
-rw-r--r--send-utils.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/send-utils.h b/send-utils.h
index 943b0277..f451c1cb 100644
--- a/send-utils.h
+++ b/send-utils.h
@@ -30,6 +30,12 @@
extern "C" {
#endif
+/*
+ * Compatibility code for kernels < 3.12; the UUID tree is not available there
+ * and we have to do the slow search. This should be deprecated someday.
+ */
+#define BTRFS_COMPAT_SEND_NO_UUID_TREE 1
+
enum subvol_search_type {
subvol_search_by_root_id,
subvol_search_by_uuid,
@@ -38,10 +44,12 @@ enum subvol_search_type {
};
struct subvol_info {
+#ifdef BTRFS_COMPAT_SEND_NO_UUID_TREE
struct rb_node rb_root_id_node;
struct rb_node rb_local_node;
struct rb_node rb_received_node;
struct rb_node rb_path_node;
+#endif
u64 root_id;
u8 uuid[BTRFS_UUID_SIZE];
@@ -57,12 +65,14 @@ struct subvol_info {
struct subvol_uuid_search {
int mnt_fd;
+#ifdef BTRFS_COMPAT_SEND_NO_UUID_TREE
int uuid_tree_existed;
struct rb_root root_id_subvols;
struct rb_root local_subvols;
struct rb_root received_subvols;
struct rb_root path_subvols;
+#endif
};
int subvol_uuid_search_init(int mnt_fd, struct subvol_uuid_search *s);