diff options
author | Chris Mason <chris.mason@fusionio.com> | 2013-05-17 21:53:17 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-05-17 21:53:17 -0400 |
commit | c5cb6a0573bef87e098ee3cd946115ebe60a910e (patch) | |
tree | 49b64747b7af6b1024b25470cba583fa7dafe531 /fs/btrfs/volumes.c | |
parent | 9be3395bcd4ad4af76476ac38152b4cafa6b6159 (diff) | |
parent | 655b09fe540b73edeaabfb4c2d700be51a1f8bce (diff) | |
download | blackbird-op-linux-c5cb6a0573bef87e098ee3cd946115ebe60a910e.tar.gz blackbird-op-linux-c5cb6a0573bef87e098ee3cd946115ebe60a910e.zip |
Merge branch 'for-chris' of git://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 317afc7a2af4..24940085cdac 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -3120,14 +3120,13 @@ int btrfs_balance(struct btrfs_balance_control *bctl, allowed = BTRFS_AVAIL_ALLOC_BIT_SINGLE; if (num_devices == 1) allowed |= BTRFS_BLOCK_GROUP_DUP; - else if (num_devices < 4) + else if (num_devices > 1) allowed |= (BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1); - else - allowed |= (BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1 | - BTRFS_BLOCK_GROUP_RAID10 | - BTRFS_BLOCK_GROUP_RAID5 | - BTRFS_BLOCK_GROUP_RAID6); - + if (num_devices > 2) + allowed |= BTRFS_BLOCK_GROUP_RAID5; + if (num_devices > 3) + allowed |= (BTRFS_BLOCK_GROUP_RAID10 | + BTRFS_BLOCK_GROUP_RAID6); if ((bctl->data.flags & BTRFS_BALANCE_ARGS_CONVERT) && (!alloc_profile_is_valid(bctl->data.target, 1) || (bctl->data.target & ~allowed))) { |