Skip to contentSkip to conversation

fs/erofs: add DEFLATE algorithm support

PATCH In review Jianan Huang 3 participants 3 messages Apr 14, 2024 – Apr 19, 2024 EROFS file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/erofs: add DEFLATE algorithm support

This patch adds DEFLATE compression algorithm support. It's a good choice to trade off between compression ratios and performance compared to LZ4. Alternatively, DEFLATE could be used for some specific files since EROFS supports multiple compression algorithms in one image.

---
 fs/erofs/Kconfig      | 15 ++++++++
 fs/erofs/decompress.c | 83 +++++++++++++++++++++++++++++++++++++++++++
 fs/erofs/erofs_fs.h   |  1 +
 3 files changed, 99 insertions(+)
fs/erofs/Kconfig +15 -0
index ee4e777c5c..c8463357ca 100644
@@ -19,3 +19,18 @@ config FS_EROFS_ZIP
 	help
 	  Enable fixed-sized output compression for EROFS.
 	  If you don't want to enable compression feature, say N.
+
+config FS_EROFS_ZIP_DEFLATE
+	bool "EROFS DEFLATE compressed data support"
+	depends on FS_EROFS_ZIP
+	select ZLIB
+	help
+	  Saying Y here includes support for reading EROFS file systems
+	  containing DEFLATE compressed data.  It gives better compression
+	  ratios than the default LZ4 format, while it costs more CPU
+	  overhead.
+
+	  DEFLATE support is an experimental feature for now and so most
+	  file systems will be readable without selecting this option.
+
+	  If unsure, say N.
fs/erofs/decompress.c +83 -0

95 lines not on this page · raw message

fs/erofs/erofs_fs.h +1 -0
index 158e2c68a1..5bac4fe1a1 100644
@@ -304,6 +304,7 @@ enum {
 enum {
 	Z_EROFS_COMPRESSION_LZ4		= 0,
 	Z_EROFS_COMPRESSION_LZMA	= 1,
+	Z_EROFS_COMPRESSION_DEFLATE	= 2,
 	Z_EROFS_COMPRESSION_MAX
 };
 
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hi Jianan,

Quoted 6 lines · Jianan Huang

This patch adds DEFLATE compression algorithm support. It's a good choice to trade off between compression ratios and performance compared to LZ4. Alternatively, DEFLATE could be used for some specific files since EROFS supports multiple compression algorithms in one image.

Thanks,
Gao Xiang

#2 lore raw
In reply to Jianan Huang
Quoted 6 lines · Jianan Huang

This patch adds DEFLATE compression algorithm support. It's a good choice to trade off between compression ratios and performance compared to LZ4. Alternatively, DEFLATE could be used for some specific files since EROFS supports multiple compression algorithms in one image.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom