summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiu Bo <bo.li.liu@oracle.com>2012-12-27 09:01:24 +0000
committerJosef Bacik <josef@toxicpanda.com>2013-01-14 13:52:52 -0500
commitac5c93005b7073732e268606688fb6c821d5310e (patch)
tree0c469fc83026b8756db5bc9f1f343768cb5dc0a1
parentf3fe820c20a1a36c790545184e734e78d61cd68d (diff)
downloadlinux-ac5c93005b7073732e268606688fb6c821d5310e.tar.gz
linux-ac5c93005b7073732e268606688fb6c821d5310e.tar.xz
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: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
-rw-r--r--fs/btrfs/extent-tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 61fefda74ff5..aeba53191ece 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -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;