Commit 44b28ada authored by David Sterba's avatar David Sterba

btrfs: use raid_attr table for btrfs_bg_type_to_factor

The factor is the number of copies.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 6079e12c
...@@ -7586,10 +7586,9 @@ void btrfs_reset_fs_info_ptr(struct btrfs_fs_info *fs_info) ...@@ -7586,10 +7586,9 @@ void btrfs_reset_fs_info_ptr(struct btrfs_fs_info *fs_info)
*/ */
int btrfs_bg_type_to_factor(u64 flags) int btrfs_bg_type_to_factor(u64 flags)
{ {
if (flags & (BTRFS_BLOCK_GROUP_DUP | BTRFS_BLOCK_GROUP_RAID1 | const int index = btrfs_bg_flags_to_raid_index(flags);
BTRFS_BLOCK_GROUP_RAID10))
return 2; return btrfs_raid_array[index].ncopies;
return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment