[PATCH v2 2/3] btrfs: use btrfs_path::reada for scrub extent tree readahead

Qu Wenruo
2021-12-14T13:02:07Z

For scrub, we trigger two readahead 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.

This patch will add the readahead for extent tree, so we can later
remove the btrfs_reada_add() based readahead.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
fs/btrfs/scrub.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 41908f0c1e76..70457aadd721 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -3247,6 +3247,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
--
2.34.1