erofs: adapt folios for z_erofs_readahead()
authorGao Xiang <hsiangkao@linux.alibaba.com>
Thu, 17 Aug 2023 08:28:12 +0000 (16:28 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Wed, 23 Aug 2023 15:47:18 +0000 (23:47 +0800)
commit491b1105a8e25d9d26ea321839e057a752e31383
treea4aa9c7f38c798929b23ecc46498a8d8f7ff2beb
parent06ec03660d819fdb88692d62a86464daf6ddb0a5
erofs: adapt folios for z_erofs_readahead()

It's a straight-forward conversion except that readahead_folio()
will do folio_put() in advance but it doesn't matter since folios
are still locked.

As before, since file-backed folios (pages for now) are locked, so
we could temporarily use folio->private as an internal counter to
indicate split parts of each folio for the corresponding pclusters
to decompress.

When such counter becomes zero, the folio will be finally unlocked
(see compress.h and z_erofs_onlinepage_endio()).

Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230817082813.81180-7-hsiangkao@linux.alibaba.com
fs/erofs/zdata.c