]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: do not start readahead for csum tree when scrubbing non-data block groups
authorFilipe Manana <fdmanana@suse.com>
Mon, 12 Oct 2020 10:55:26 +0000 (11:55 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 8 Dec 2020 14:53:39 +0000 (15:53 +0100)
commitae4dc75ccb38a9acf2a66f84bdd0398bb50375f0
tree22447d09752344fa5cbe9e5da5278fc6162adf69
parenta8d210ba1677553c13acc749573e6bd7b369b25e
btrfs: do not start readahead for csum tree when scrubbing non-data block groups

When scrubbing a stripe of a block group we always start readahead for the
checksums btree and wait for it to complete, however when the blockgroup is
not a data block group (or a mixed block group) it is a waste of time to do
it, since there are no checksums for metadata extents in that btree.

So skip that when the block group does not have the data flag set, saving
some time doing memory allocations, queueing a job in the readahead work
queue, waiting for it to complete and potentially avoiding some IO as well
(when csum tree extents are not in memory already).

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/scrub.c