Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1095cc0d authored by chandan's avatar chandan Committed by Chris Mason
Browse files

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: default avatarchandan <chandan@linux.vnet.ibm.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.cz>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent 3cae210f
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -8441,9 +8441,13 @@ int btrfs_read_block_groups(struct btrfs_root *root)
		 * avoid allocating from un-mirrored block group if there are
		 * avoid allocating from un-mirrored block group if there are
		 * mirrored block groups.
		 * 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);
			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);
			set_block_group_ro(cache, 1);
	}
	}