aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/btrfs_tree.h
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2018-03-02 22:56:53 +0100
committerDavid Sterba <dsterba@suse.com>2019-11-18 17:51:49 +0100
commit8d6fac0087e538173f34ca7431ed9b58581acf28 (patch)
tree83a1c2bc2bf18cb604ce09124c1933e06d845c4d /include/uapi/linux/btrfs_tree.h
parentbtrfs: add support for 3-copy replication (raid1c3) (diff)
downloadlinux-dev-8d6fac0087e538173f34ca7431ed9b58581acf28.tar.xz
linux-dev-8d6fac0087e538173f34ca7431ed9b58581acf28.zip
btrfs: add support for 4-copy replication (raid1c4)
Add new block group profile to store 4 copies in a simliar way that current RAID1 does. The profile attributes and constraints are defined in the raid table and used by the same code that already handles the 2- and 3-copy RAID1. The minimum number of devices is 4, the maximum number of devices/chunks that can be lost/damaged is 3. There is no comparable traditional RAID level, the profile is added for future needs to accompany triple-parity and beyond. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'include/uapi/linux/btrfs_tree.h')
-rw-r--r--include/uapi/linux/btrfs_tree.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h
index 52b2964b0311..8e322e2c7e78 100644
--- a/include/uapi/linux/btrfs_tree.h
+++ b/include/uapi/linux/btrfs_tree.h
@@ -842,6 +842,7 @@ struct btrfs_dev_replace_item {
#define BTRFS_BLOCK_GROUP_RAID5 (1ULL << 7)
#define BTRFS_BLOCK_GROUP_RAID6 (1ULL << 8)
#define BTRFS_BLOCK_GROUP_RAID1C3 (1ULL << 9)
+#define BTRFS_BLOCK_GROUP_RAID1C4 (1ULL << 10)
#define BTRFS_BLOCK_GROUP_RESERVED (BTRFS_AVAIL_ALLOC_BIT_SINGLE | \
BTRFS_SPACE_INFO_GLOBAL_RSV)
@@ -854,6 +855,7 @@ enum btrfs_raid_types {
BTRFS_RAID_RAID5,
BTRFS_RAID_RAID6,
BTRFS_RAID_RAID1C3,
+ BTRFS_RAID_RAID1C4,
BTRFS_NR_RAID_TYPES
};
@@ -864,6 +866,7 @@ enum btrfs_raid_types {
#define BTRFS_BLOCK_GROUP_PROFILE_MASK (BTRFS_BLOCK_GROUP_RAID0 | \
BTRFS_BLOCK_GROUP_RAID1 | \
BTRFS_BLOCK_GROUP_RAID1C3 | \
+ BTRFS_BLOCK_GROUP_RAID1C4 | \
BTRFS_BLOCK_GROUP_RAID5 | \
BTRFS_BLOCK_GROUP_RAID6 | \
BTRFS_BLOCK_GROUP_DUP | \
@@ -872,7 +875,8 @@ enum btrfs_raid_types {
BTRFS_BLOCK_GROUP_RAID6)
#define BTRFS_BLOCK_GROUP_RAID1_MASK (BTRFS_BLOCK_GROUP_RAID1 | \
- BTRFS_BLOCK_GROUP_RAID1C3)
+ BTRFS_BLOCK_GROUP_RAID1C3 | \
+ BTRFS_BLOCK_GROUP_RAID1C4)
/*
* We need a bit for restriper to be able to tell when chunks of type