erofs: support large folios for fscache mode
authorJingbo Xu <jefflexu@linux.alibaba.com>
Thu, 1 Dec 2022 07:42:55 +0000 (15:42 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Wed, 7 Dec 2022 02:56:30 +0000 (10:56 +0800)
commitbe62c5198861156d77b60babb89e70e21c73eb7b
treeb7a54d2bff8da97236adac5f85b824404f3f9116
parent709fe09e281776b5e024fb5934c0485a866b7468
erofs: support large folios for fscache mode

When large folios supported, one folio can be split into several slices,
each of which may be mapped to META/UNMAPPED/MAPPED, and the folio can
be unlocked as a whole only when all slices have completed.

Thus always allocate erofs_fscache_request for each .read_folio() or
.readahead(), in which case the allocated request is responsible for
unlocking folios when all slices have completed.

As described above, each folio or folio range can be mapped into several
slices, while these slices may be mapped to different cookies, and thus
each slice needs its own netfs_cache_resources.  Here we introduce
chained requests to support this, where each .read_folio() or
.readahead() calling can correspond to multiple requests.  Each request
has its own netfs_cache_resources and thus is used to access one cookie.
Among these requests, there's a primary request, with the others
pointing to the primary request.

Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Reviewed-by: Jia Zhu <zhujia.zj@bytedance.com>
Link: https://lore.kernel.org/r/20221201074256.16639-2-jefflexu@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
fs/erofs/fscache.c