summaryrefslogtreecommitdiff
path: root/send-utils.h
diff options
context:
space:
mode:
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>2014-01-09 18:52:38 +0800
committerChris Mason <clm@fb.com>2014-01-31 08:22:30 -0800
commit83ccf085099d5e300b47b0661eda68d3bad034e6 (patch)
tree51e0b2e399fd44593c1cbb7f8d7332915bc42f01 /send-utils.h
parentcf822f5dbaddb02a6e9a9b25e5979195f935f02e (diff)
downloadbtrfs-progs-83ccf085099d5e300b47b0661eda68d3bad034e6.tar.gz
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 <ablock84@googlemail.com> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'send-utils.h')
-rw-r--r--send-utils.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/send-utils.h b/send-utils.h
index ed1a40e..943b027 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 uuid[BTRFS_UUID_SIZE];
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);