Linux-EROFS Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <xiang@kernel.org>
To: linux-erofs@lists.ozlabs.org
Subject: [PATCH] erofs-utils: bump up EROFS_CONFIG_COMPR_MAX_SZ
Date: Mon, 13 Jun 2022 00:45:18 +0800	[thread overview]
Message-ID: <20220612164518.503836-1-xiang@kernel.org> (raw)

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

Signed-off-by: Gao Xiang <xiang@kernel.org>
---
 include/erofs/compress.h | 4 +---
 lib/compress.c           | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/erofs/compress.h b/include/erofs/compress.h
index 40df2bc..24f6204 100644
--- a/include/erofs/compress.h
+++ b/include/erofs/compress.h
@@ -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);
diff --git a/lib/compress.c b/lib/compress.c
index 7ebc534..ee3b856 100644
--- a/lib/compress.c
+++ b/lib/compress.c
@@ -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;
-- 
2.30.2


                 reply	other threads:[~2022-06-12 16:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220612164518.503836-1-xiang@kernel.org \
    --to=xiang@kernel.org \
    --cc=linux-erofs@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox