path: root/send-utils.h
diff options
authorWang Shilong <>2014-01-09 18:52:38 +0800
committerChris Mason <>2014-01-31 08:22:30 -0800
commit83ccf085099d5e300b47b0661eda68d3bad034e6 (patch)
tree51e0b2e399fd44593c1cbb7f8d7332915bc42f01 /send-utils.h
parentcf822f5dbaddb02a6e9a9b25e5979195f935f02e (diff)
Btrfs-progs: make send/receive compatible with older kernels
Some users complaint that with latest btrfs-progs, they will fail to use send/receive. The problem is new tool will try to use uuid tree while it dosen't work on older kernel. Now we first check if we support uuid tree, if not we fall into normal search as previous way.i copy most of codes from Alexander Block's previous codes and did some adjustments to make it work. Signed-off-by: Alexander Block <> Signed-off-by: Wang Shilong <> Signed-off-by: David Sterba <> Signed-off-by: Chris Mason <>
Diffstat (limited to 'send-utils.h')
1 files changed, 11 insertions, 0 deletions
diff --git a/send-utils.h b/send-utils.h
index ed1a40e0..943b0277 100644
--- a/send-utils.h
+++ b/send-utils.h
@@ -38,6 +38,11 @@ enum subvol_search_type {
struct subvol_info {
+ 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;
u64 root_id;
u8 parent_uuid[BTRFS_UUID_SIZE];
@@ -52,6 +57,12 @@ struct subvol_info {
struct subvol_uuid_search {
int mnt_fd;
+ 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;
int subvol_uuid_search_init(int mnt_fd, struct subvol_uuid_search *s);