Skip to content

Commit 06ec036

Browse files
committed
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 <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Gao Xiang <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9a05c6a commit 06ec036

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

fs/erofs/zdata.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,6 @@ struct z_erofs_decompress_frontend {
528528
z_erofs_next_pcluster_t owned_head;
529529
enum z_erofs_pclustermode mode;
530530

531-
/* used for applying cache strategy on the fly */
532-
bool backmost;
533531
erofs_off_t headoffset;
534532

535533
/* a pointer used to pick up inplace I/O pages */
@@ -538,7 +536,7 @@ struct z_erofs_decompress_frontend {
538536

539537
#define DECOMPRESS_FRONTEND_INIT(__i) { \
540538
.inode = __i, .owned_head = Z_EROFS_PCLUSTER_TAIL, \
541-
.mode = Z_EROFS_PCLUSTER_FOLLOWED, .backmost = true }
539+
.mode = Z_EROFS_PCLUSTER_FOLLOWED }
542540

543541
static bool z_erofs_should_alloc_cache(struct z_erofs_decompress_frontend *fe)
544542
{
@@ -547,7 +545,7 @@ static bool z_erofs_should_alloc_cache(struct z_erofs_decompress_frontend *fe)
547545
if (cachestrategy <= EROFS_ZIP_CACHE_DISABLED)
548546
return false;
549547

550-
if (fe->backmost)
548+
if (!(fe->map.m_flags & EROFS_MAP_FULL_MAPPED))
551549
return true;
552550

553551
if (cachestrategy >= EROFS_ZIP_CACHE_READAROUND &&
@@ -940,7 +938,6 @@ static void z_erofs_pcluster_end(struct z_erofs_decompress_frontend *fe)
940938
erofs_workgroup_put(&pcl->obj);
941939

942940
fe->pcl = NULL;
943-
fe->backmost = false;
944941
}
945942

946943
static int z_erofs_read_fragment(struct super_block *sb, struct page *page,

0 commit comments

Comments
 (0)