]> git.hungrycats.org Git - linux/commit
btrfs: relocation: Check cancel request after each extent found
authorQu Wenruo <wqu@suse.com>
Tue, 3 Dec 2019 06:42:53 +0000 (14:42 +0800)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sun, 8 Dec 2019 03:18:36 +0000 (22:18 -0500)
commit3e0b705ea6ce42941083c89b56273ae160cf9ce6
tree3066dd0e7084e1960f6394608af02ec7598edada
parentd98b3fc6f2b4d733b4abcbb79dfd47daacee1b4f
btrfs: relocation: Check cancel request after each extent found

When relocating data block groups with tons of small extents, or
large metadata block groups, there can be over 200,000 extents.

We will iterate all extents of such block group in relocate_block_group(),
where iteration itself can be kinda time-consuming.

So when user want to cancel the balance, the extent iteration loop can
be another target.

This patch will add the cancelling check in the extent iteration loop of
relocate_block_group() to make balance cancelling faster.

Signed-off-by: Qu Wenruo <wqu@suse.com>
(cherry picked from commit 400faee53af2f9f1d0d4a0e0f92ea3d08fe53d59)
fs/btrfs/relocation.c