aboutsummaryrefslogtreecommitdiffstats
path: root/fs/erofs
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@linux.alibaba.com>2023-08-17 16:28:11 +0800
committerGao Xiang <hsiangkao@linux.alibaba.com>2023-08-23 23:46:42 +0800
commit06ec03660d819fdb88692d62a86464daf6ddb0a5 (patch)
treefff9870c5b6606b7661adc16475e0a5cf59a7814 /fs/erofs
parent9a05c6a8bc26138d34e87b39e6a815603bc2a66c (diff)
downloadlinux-06ec03660d819fdb88692d62a86464daf6ddb0a5.tar.gz
erofs: get rid of fe->backmost for cache decompression
EROFS_MAP_FULL_MAPPED is more accurate to decide if caching the last incomplete pcluster for later read or not. Reviewed-by: Yue Hu <huyue2@coolpad.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: https://lore.kernel.org/r/20230817082813.81180-6-hsiangkao@linux.alibaba.com
Diffstat (limited to 'fs/erofs')
-rw-r--r--fs/erofs/zdata.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 82834e302fb4b..7e55e95bc33ab 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -528,8 +528,6 @@ struct z_erofs_decompress_frontend {
z_erofs_next_pcluster_t owned_head;
enum z_erofs_pclustermode mode;
- /* used for applying cache strategy on the fly */
- bool backmost;
erofs_off_t headoffset;
/* a pointer used to pick up inplace I/O pages */
@@ -538,7 +536,7 @@ struct z_erofs_decompress_frontend {
#define DECOMPRESS_FRONTEND_INIT(__i) { \
.inode = __i, .owned_head = Z_EROFS_PCLUSTER_TAIL, \
- .mode = Z_EROFS_PCLUSTER_FOLLOWED, .backmost = true }
+ .mode = Z_EROFS_PCLUSTER_FOLLOWED }
static bool z_erofs_should_alloc_cache(struct z_erofs_decompress_frontend *fe)
{
@@ -547,7 +545,7 @@ static bool z_erofs_should_alloc_cache(struct z_erofs_decompress_frontend *fe)
if (cachestrategy <= EROFS_ZIP_CACHE_DISABLED)
return false;
- if (fe->backmost)
+ if (!(fe->map.m_flags & EROFS_MAP_FULL_MAPPED))
return true;
if (cachestrategy >= EROFS_ZIP_CACHE_READAROUND &&
@@ -940,7 +938,6 @@ static void z_erofs_pcluster_end(struct z_erofs_decompress_frontend *fe)
erofs_workgroup_put(&pcl->obj);
fe->pcl = NULL;
- fe->backmost = false;
}
static int z_erofs_read_fragment(struct super_block *sb, struct page *page,