Skip to contentSkip to conversation

erofs-utils: bump up EROFS_CONFIG_COMPR_MAX_SZ

PATCH New Gao Xiang 1 participant 1 message Jun 12, 2022 Library code

lore
Share & tools
lore

Gao Xiang

author
#0 lore raw

PATCH 1/1 erofs-utils: bump up EROFS_CONFIG_COMPR_MAX_SZ

Otherwise, compression ratios could be limited when pcluster size is large. Use a static variable for now.

---
 include/erofs/compress.h | 4 +---
 lib/compress.c           | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)
include/erofs/compress.h +1 -3
index 40df2bc..24f6204 100644
@@ -14,9 +14,7 @@ extern "C"
 
 #include "internal.h"
 
-/* workaround for an upstream lz4 compression issue, which can crash us */
-/* #define EROFS_CONFIG_COMPR_MAX_SZ        (1024 * 1024) */
-#define EROFS_CONFIG_COMPR_MAX_SZ           (900  * 1024)
+#define EROFS_CONFIG_COMPR_MAX_SZ           (3000 * 1024)
 #define EROFS_CONFIG_COMPR_MIN_SZ           (32   * 1024)
 
 void z_erofs_drop_inline_pcluster(struct erofs_inode *inode);
lib/compress.c +1 -1
index 7ebc534..ee3b856 100644
@@ -607,7 +607,7 @@ void z_erofs_drop_inline_pcluster(struct erofs_inode *inode)
 int erofs_write_compressed_file(struct erofs_inode *inode)
 {
 	struct erofs_buffer_head *bh;
-	struct z_erofs_vle_compress_ctx ctx;
+	static struct z_erofs_vle_compress_ctx ctx;
 	erofs_off_t remaining;
 	erofs_blk_t blkaddr, compressed_blocks;
 	unsigned int legacymetasize;
Signature · 1 line
2.30.2