mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
synced 2024-11-24 04:34:15 +08:00
btrfs-progs: use btrfs_bg_type_to_nparity in calc_stripe_length
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
e3355b43b4
commit
833ce53872
@ -222,12 +222,9 @@ static inline u64 calc_stripe_length(u64 type, u64 length, int num_stripes)
|
||||
} else if (type & BTRFS_BLOCK_GROUP_RAID10) {
|
||||
stripe_size = length * 2;
|
||||
stripe_size /= num_stripes;
|
||||
} else if (type & BTRFS_BLOCK_GROUP_RAID5) {
|
||||
} else if (type & BTRFS_BLOCK_GROUP_RAID56_MASK) {
|
||||
stripe_size = length;
|
||||
stripe_size /= (num_stripes - 1);
|
||||
} else if (type & BTRFS_BLOCK_GROUP_RAID6) {
|
||||
stripe_size = length;
|
||||
stripe_size /= (num_stripes - 2);
|
||||
stripe_size /= (num_stripes - btrfs_bg_type_to_nparity(type));
|
||||
} else {
|
||||
stripe_size = length;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user