summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorchandan2013-07-16 08:58:56 +0200
committerChris Mason2013-09-01 13:57:38 +0200
commit1095cc0d924e1c61fb34e0bfcec049d1fbcca77c (patch)
treed90cde159b3d0819d4628ceda70f1fee06eb4236 /fs/btrfs/extent-tree.c
parentbtrfs: Cleanup for using BTRFS_SETGET_STACK instead of raw convert (diff)
downloadkernel-qcow2-linux-1095cc0d924e1c61fb34e0bfcec049d1fbcca77c.tar.gz
kernel-qcow2-linux-1095cc0d924e1c61fb34e0bfcec049d1fbcca77c.tar.xz
kernel-qcow2-linux-1095cc0d924e1c61fb34e0bfcec049d1fbcca77c.zip
btrfs_read_block_groups: Use enums to index
btrfs_space_info->block_groups. The current code uses integer literals to index btrfs_space_info->block_groups[] array. Instead use corresponding enums from 'enum btrfs_raid_types'. Signed-off-by: chandan <chandan@linux.vnet.ibm.com> Reviewed-by: David Sterba <dsterba@suse.cz> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 99aa9b77e948..a770a6318433 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -8441,9 +8441,13 @@ int btrfs_read_block_groups(struct btrfs_root *root)
* avoid allocating from un-mirrored block group if there are
* mirrored block groups.
*/
- list_for_each_entry(cache, &space_info->block_groups[3], list)
+ list_for_each_entry(cache,
+ &space_info->block_groups[BTRFS_RAID_RAID0],
+ list)
set_block_group_ro(cache, 1);
- list_for_each_entry(cache, &space_info->block_groups[4], list)
+ list_for_each_entry(cache,
+ &space_info->block_groups[BTRFS_RAID_SINGLE],
+ list)
set_block_group_ro(cache, 1);
}