btrfs: use btrfs_raid_array for btrfs_get_num_tolerated_disk_barrier_failures()
authorZhao Lei <zhaolei@cn.fujitsu.com>
Tue, 15 Sep 2015 13:08:07 +0000 (21:08 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 21 Oct 2015 16:28:48 +0000 (18:28 +0200)
commit8789f4fe608922f484369382a8e507ca12df7f4e
treed956b1ad487ffd551896bced20525bb973088ba2
parentaf902047508d3619499cbbc2f7c4c5e16428b2e3
btrfs: use btrfs_raid_array for btrfs_get_num_tolerated_disk_barrier_failures()

btrfs_raid_array[] is used to define all raid attributes, use it
to get tolerated_failures in btrfs_get_num_tolerated_disk_barrier_failures(),
instead of complex condition in function.

It can make code simple and auto-support other possible raid-type in
future.

Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h