]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: don't wait for unrelated IO to finish before relocation
authorFilipe Manana <fdmanana@suse.com>
Tue, 26 Apr 2016 14:36:38 +0000 (15:36 +0100)
committerFilipe Manana <fdmanana@suse.com>
Fri, 13 May 2016 00:59:14 +0000 (01:59 +0100)
commit5edb445aadab6a618c8c8286361cd90b25256b71
treec6b2e052c0ba5b95d1659f0e95651445951426e1
parent6a8f88c6b2d1d33735a7e5442828b9be785f84bb
Btrfs: don't wait for unrelated IO to finish before relocation

Before the relocation process of a block group starts, it sets the block
group to readonly mode, then flushes all delalloc writes and then finally
it waits for all ordered extents to complete. This last step includes
waiting for ordered extents destinated at extents allocated in other block
groups, making us waste unecessary time.

So improve this by waiting only for ordered extents that fall into the
block group's range.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
fs/btrfs/dev-replace.c
fs/btrfs/extent-tree.c
fs/btrfs/ioctl.c
fs/btrfs/ordered-data.c
fs/btrfs/ordered-data.h
fs/btrfs/relocation.c
fs/btrfs/super.c
fs/btrfs/transaction.c