]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
erofs: tidy up `struct z_erofs_bvec`
authorGao Xiang <hsiangkao@linux.alibaba.com>
Wed, 3 Jul 2024 12:00:51 +0000 (20:00 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Mon, 8 Jul 2024 14:09:42 +0000 (22:09 +0800)
commit2080ca1ed3e43233c4e8480c0b9d2840886de01e
tree67056d71f4ecc373470ae684d5c7035729c77f84
parent5b9654efb60423284dd0f8845812ac7216f60858
erofs: tidy up `struct z_erofs_bvec`

After revisiting the design, I believe `struct z_erofs_bvec` should
be page-based instead of folio-based due to the reasons below:

 - The minimized memory mapping block is a page;

 - Under the certain circumstances, only temporary pages needs to be
   used instead of folios since refcount, mapcount for such pages are
   unnecessary;

 - Decompressors handle all types of pages including temporary pages,
   not only folios.

When handling `struct z_erofs_bvec`, all folio-related information
is now accessed using the page_folio() helper.

The final goal of this round adaptation is to eliminate direct
accesses to `struct page` in the EROFS codebase, except for some
exceptions like `z_erofs_is_shortlived_page()` and
`z_erofs_page_is_invalidated()`, which require a new helper to
determine the memdesc type of an arbitrary page.

Actually large folios of compressed files seem to work now, yet I tend
to conduct more tests before officially enabling this for all scenarios.

Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20240703120051.3653452-4-hsiangkao@linux.alibaba.com
fs/erofs/zdata.c