f2fs: avoid splitting bio when reading multiple pages
authorJianan Huang <huangjianan@xiaomi.com>
Mon, 30 Jun 2025 12:57:53 +0000 (20:57 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 1 Jul 2025 16:22:07 +0000 (16:22 +0000)
commit185f203a6991f7dd7f8070d6638415215da35d7e
tree8247fa6d40a06831c02da8cecd7de9d67eff4cff
parente23ab8028de0d92df5921a570f5212c0370db3b5
f2fs: avoid splitting bio when reading multiple pages

When fewer pages are read, nr_pages may be smaller than nr_cpages. Due
to the nr_vecs limit, the compressed pages will be split into multiple
bios and then merged at the block level. In this case, nr_cpages should
be used to pre-allocate bvecs.
To handle this case, align max_nr_pages to cluster_size, which should be
enough for all compressed pages.

Signed-off-by: Jianan Huang <huangjianan@xiaomi.com>
Signed-off-by: Sheng Yong <shengyong1@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c