]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: use ncopies from btrfs_raid_array in btrfs_num_copies()
authorQu Wenruo <wqu@suse.com>
Fri, 13 May 2022 08:34:31 +0000 (16:34 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:45:36 +0000 (17:45 +0200)
commitbf5055811d153248b38cf04585c47181ff5f3c64
tree15f1272375af964e261af4a0a5458269fda16322
parent3cdd412744a5127f2187a5ed8b0cb23b43f76390
btrfs: use ncopies from btrfs_raid_array in btrfs_num_copies()

For all non-RAID56 profiles, we can use btrfs_raid_array[].ncopies
directly, only for RAID5 and RAID6 we need some extra handling as
there's no table value for that.

For RAID10 there's a change from sub_stripes to ncopies. The values are
the same but semantically we want to use number of copies, as this is
what btrfs_num_copies does.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c