]> Pileus Git - ~andy/linux/commit
Btrfs: improve the logic in btrfs_can_relocate()
authorIlya Dryomov <idryomov@gmail.com>
Tue, 27 Mar 2012 14:09:17 +0000 (17:09 +0300)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 27 Mar 2012 14:09:17 +0000 (17:09 +0300)
commit4a5e98f5d61f698452e564e0cde34c16a6b65752
treed65c346e8763380a1afac2984abc12533ecf15b7
parent7738a53a3a3aa8d82350280ff4bc7df9c3094123
Btrfs: improve the logic in btrfs_can_relocate()

Currently if we don't have enough space allocated we go ahead and loop
though devices in the hopes of finding enough space for a chunk of the
*same* type as the one we are trying to relocate.  The problem with that
is that if we are trying to restripe the chunk its target type can be
more relaxed than the current one (eg require less devices or less
space).  So, when restriping, run checks against the target profile
instead of the current one.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/btrfs/extent-tree.c