summaryrefslogtreecommitdiff
path: root/fs/erofs/zdata.h
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@linux.alibaba.com>2022-07-15 18:42:02 +0300
committerGao Xiang <hsiangkao@linux.alibaba.com>2022-07-21 17:55:44 +0300
commit2bfab9c0edac5f6031e8956477cd39f7162b208d (patch)
tree6a31cb1fe91c9a9b8da06cdc3a584bd53b1844b6 /fs/erofs/zdata.h
parent3fe96ee0f96d0b2117b0ef438e28c26655b370f8 (diff)
downloadlinux-2bfab9c0edac5f6031e8956477cd39f7162b208d.tar.xz
erofs: record the longest decompressed size in this round
Currently, `pcl->length' records the longest decompressed length as long as the pcluster itself isn't reclaimed. However, such number is unneeded for the general cases since it doesn't indicate the exact decompressed size in this round. Instead, let's record the decompressed size for this round instead, thus `pcl->nr_pages' can be completely dropped and pageofs_out is also designed to be kept in sync with `pcl->length'. Acked-by: Chao Yu <chao@kernel.org> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: https://lore.kernel.org/r/20220715154203.48093-16-hsiangkao@linux.alibaba.com
Diffstat (limited to 'fs/erofs/zdata.h')
-rw-r--r--fs/erofs/zdata.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/erofs/zdata.h b/fs/erofs/zdata.h
index be0f19aa0d2d..4ae3b763bc27 100644
--- a/fs/erofs/zdata.h
+++ b/fs/erofs/zdata.h
@@ -12,9 +12,6 @@
#define Z_EROFS_PCLUSTER_MAX_PAGES (Z_EROFS_PCLUSTER_MAX_SIZE / PAGE_SIZE)
#define Z_EROFS_INLINE_BVECS 2
-#define Z_EROFS_PCLUSTER_FULL_LENGTH 0x00000001
-#define Z_EROFS_PCLUSTER_LENGTH_BIT 1
-
/*
* let's leave a type here in case of introducing
* another tagged pointer later.
@@ -53,7 +50,7 @@ struct z_erofs_pcluster {
/* A: point to next chained pcluster or TAILs */
z_erofs_next_pcluster_t next;
- /* A: lower limit of decompressed length and if full length or not */
+ /* L: the maximum decompression size of this round */
unsigned int length;
/* L: total number of bvecs */
@@ -65,9 +62,6 @@ struct z_erofs_pcluster {
/* I: page offset of inline compressed data */
unsigned short pageofs_in;
- /* L: maximum relative page index in bvecs */
- unsigned short nr_pages;
-
union {
/* L: inline a certain number of bvec for bootstrap */
struct z_erofs_bvset_inline bvset;
@@ -87,6 +81,9 @@ struct z_erofs_pcluster {
/* I: compression algorithm format */
unsigned char algorithmformat;
+ /* L: whether partial decompression or not */
+ bool partial;
+
/* A: compressed bvecs (can be cached or inplaced pages) */
struct z_erofs_bvec compressed_bvecs[];
};