From af902047508d3619499cbbc2f7c4c5e16428b2e3 Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Tue, 15 Sep 2015 21:08:06 +0800 Subject: btrfs: Move btrfs_raid_array to public This array is used to record attributes of each raid type, make it public, and many functions will benifit with this array. For example, num_tolerated_disk_barrier_failures(), we can avoid complex conditions in this function, and get raid attribute simply by accessing above array. It can also make code logic simple, reduce duplication code, and increase maintainability. Reviewed-by: David Sterba Signed-off-by: Zhao Lei Signed-off-by: David Sterba --- fs/btrfs/volumes.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fs/btrfs/volumes.h') diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 2ca784a..75d6083 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -338,6 +338,10 @@ struct btrfs_raid_attr { int ncopies; /* how many copies to data has */ }; +extern const struct btrfs_raid_attr btrfs_raid_array[BTRFS_NR_RAID_TYPES]; + +extern const u64 btrfs_raid_group[BTRFS_NR_RAID_TYPES]; + struct map_lookup { u64 type; int io_align; -- cgit v1.1