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

Commit ac5c9300 authored by Liu Bo's avatar Liu Bo Committed by Josef Bacik
Browse files

Btrfs: let allocation start from the right raid type



This'd avoid us empty looping.

Say we have only one disk and the metadata raid type will be defaultly DUP,
and we do not need to start from index=0(RAID10) and get over two empty
loops to index=2(DUP).

Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
parent f3fe820c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5560,7 +5560,7 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
	int empty_cluster = 2 * 1024 * 1024;
	struct btrfs_space_info *space_info;
	int loop = 0;
	int index = 0;
	int index = __get_raid_index(data);
	int alloc_type = (data & BTRFS_BLOCK_GROUP_DATA) ?
		RESERVE_ALLOC_NO_ACCOUNT : RESERVE_ALLOC;
	bool found_uncached_bg = false;