diff options
author | David Sterba <dsterba@suse.com> | 2019-05-17 11:43:31 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-07-01 13:34:57 +0200 |
commit | 44b28adafd1f814fbde8b53a99eee83f3b31b2d9 (patch) | |
tree | 312111c38de1ae8f9bc2c4b4ec2b23cc6feb4dca /fs/btrfs/volumes.c | |
parent | btrfs: use raid_attr table to find profiles for integrity lowering (diff) | |
download | linux-44b28adafd1f814fbde8b53a99eee83f3b31b2d9.tar.xz linux-44b28adafd1f814fbde8b53a99eee83f3b31b2d9.zip |
btrfs: use raid_attr table for btrfs_bg_type_to_factor
The factor is the number of copies.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 71add22e041a..bbc195c97c74 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -7586,10 +7586,9 @@ void btrfs_reset_fs_info_ptr(struct btrfs_fs_info *fs_info) */ int btrfs_bg_type_to_factor(u64 flags) { - if (flags & (BTRFS_BLOCK_GROUP_DUP | BTRFS_BLOCK_GROUP_RAID1 | - BTRFS_BLOCK_GROUP_RAID10)) - return 2; - return 1; + const int index = btrfs_bg_flags_to_raid_index(flags); + + return btrfs_raid_array[index].ncopies; } |