diff options
author | David Sterba <dsterba@suse.com> | 2018-03-02 22:56:53 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-11-18 17:51:49 +0100 |
commit | 47e6f7423b9196ad6832d26cae52b7015f81ee7f (patch) | |
tree | 3f06408a77645e1546ed90445cf6584c515ca44d /fs/btrfs/super.c | |
parent | btrfs: sink write flags to cow_file_range_async (diff) | |
download | linux-47e6f7423b9196ad6832d26cae52b7015f81ee7f.tar.xz linux-47e6f7423b9196ad6832d26cae52b7015f81ee7f.zip |
btrfs: add support for 3-copy replication (raid1c3)
Add new block group profile to store 3 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-copy RAID1.
The minimum number of devices is 3, the maximum number of devices/chunks
that can be lost/damaged is 2. Like RAID6 but with 33% space
utilization.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 3f49407cc2aa..a5aff138e2e0 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1935,6 +1935,8 @@ static inline int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info, num_stripes = nr_devices; else if (type & BTRFS_BLOCK_GROUP_RAID1) num_stripes = 2; + else if (type & BTRFS_BLOCK_GROUP_RAID1C3) + num_stripes = 3; else if (type & BTRFS_BLOCK_GROUP_RAID10) num_stripes = 4; |