summaryrefslogtreecommitdiff
path: root/ctree.h
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2018-02-09 15:44:22 +0800
committerDavid Sterba <dsterba@suse.com>2018-02-24 01:37:17 +0100
commit12becfe1220bb4e45e529d4d2363394431605deb (patch)
tree15ed445d1ffaaa877a10f63b7eafea273188481a /ctree.h
parente9097ad59321f30e05bbc0cd1b41224b26125088 (diff)
btrfs-progs: Introduce btrfs_raid_array and related infrastructures
As part of the effort to unify code and behavior between btrfs-progs and kernel, copy the btrfs_raid_array from kernel to btrfs-progs. So later we can use the btrfs_raid_array[] to get needed raid info other than manually do if-else branches. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'ctree.h')
-rw-r--r--ctree.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/ctree.h b/ctree.h
index 17cdac76..c76849d8 100644
--- a/ctree.h
+++ b/ctree.h
@@ -958,7 +958,17 @@ struct btrfs_csum_item {
#define BTRFS_BLOCK_GROUP_RAID5 (1ULL << 7)
#define BTRFS_BLOCK_GROUP_RAID6 (1ULL << 8)
#define BTRFS_BLOCK_GROUP_RESERVED BTRFS_AVAIL_ALLOC_BIT_SINGLE
-#define BTRFS_NR_RAID_TYPES 7
+
+enum btrfs_raid_types {
+ BTRFS_RAID_RAID10,
+ BTRFS_RAID_RAID1,
+ BTRFS_RAID_DUP,
+ BTRFS_RAID_RAID0,
+ BTRFS_RAID_SINGLE,
+ BTRFS_RAID_RAID5,
+ BTRFS_RAID_RAID6,
+ BTRFS_NR_RAID_TYPES
+};
#define BTRFS_BLOCK_GROUP_TYPE_MASK (BTRFS_BLOCK_GROUP_DATA | \
BTRFS_BLOCK_GROUP_SYSTEM | \