]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit - fs/btrfs/relocation.c
btrfs: relocation: Check cancel request after each extent found
authorQu Wenruo <wqu@suse.com>
Mon, 17 Feb 2020 06:16:54 +0000 (14:16 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Mar 2020 16:01:55 +0000 (17:01 +0100)
commitf31ea0888caeee75bb8a8514c9f8f28b521b55df
treef86326c32152f0f900a813f1231e08416033a6c8
parent7f913c7cfec62b91ceb4383c4dfb481092ae9d20
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.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/relocation.c