]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: scrub: use btrfs_path::reada for extent tree readahead
authorQu Wenruo <wqu@suse.com>
Tue, 14 Dec 2021 13:01:44 +0000 (21:01 +0800)
committerDavid Sterba <dsterba@suse.com>
Fri, 7 Jan 2022 13:18:26 +0000 (14:18 +0100)
For scrub, we trigger two readaheads for two trees, extent tree to get
where to scrub, and csum tree to get the data checksum.

For csum tree we already trigger readahead in
btrfs_lookup_csums_range(), by setting path->reada.
But for extent tree we don't have any path based readahead.

Add the readahead for extent tree as well, so we can later remove the
btrfs_reada_add() based readahead.

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/scrub.c

index 92fd2be6cd65f9fb59644a6acfea957ec7f43024..ad10a5e70e73181b55e333459285122b713fd55a 100644 (file)
@@ -3240,6 +3240,7 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx,
         */
        path->search_commit_root = 1;
        path->skip_locking = 1;
+       path->reada = READA_FORWARD;
 
        /*
         * trigger the readahead for extent tree csum tree and wait for