diff options
author | David Sterba <dsterba@suse.cz> | 2014-01-21 16:32:44 +0100 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-03-21 06:23:07 -0700 |
commit | 197c6d85ffbfabcb262b111ee0fb373c414d425f (patch) | |
tree | 4df513f2326126e02380bf711e8d4bf640963d84 /send-utils.h | |
parent | 31f30c99757057880c89f36b3e47eb1ec0af19d1 (diff) |
btrfs-progs: enclose uuid tree compat code with ifdefs
Commit "Btrfs-progs: make send/receive compatible with older kernels"
adds code that will become deprecated, let's clearly mark it in the
sources.
CC: Stefan Behrens <sbehrens@giantdisaster.de>
CC: 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.h | 10 |
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); |