From: Gao Xiang <xiang@kernel.org>
To: linux-erofs@lists.ozlabs.org
Cc: Gao Xiang <xiang@kernel.org>
Subject: [PATCH v2 3/4] erofs-utils: lib: switch to use per-inode big pcluster flag
Date: Tue, 15 Sep 2026 14:21:38 +0800 [thread overview]
Message-ID: <20260915062139.54810-3-xiang@kernel.org> (raw)
In-Reply-To: <20260915062139.54810-1-xiang@kernel.org>
Some inodes can be non-big-pclusters but the filesystem can have big
pcluster inodes.
Signed-off-by: Gao Xiang <xiang@kernel.org>
---
lib/compress.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/compress.c b/lib/compress.c
index ef79eaa..cda138f 100644
--- a/lib/compress.c
+++ b/lib/compress.c
@@ -168,6 +168,7 @@ static void z_erofs_write_full_indexes(struct z_erofs_index_writer *ctx,
{
struct erofs_inode *inode = ctx->inode;
struct erofs_sb_info *sbi = inode->sbi;
+ bool big_pcluster = inode->z_advise & Z_EROFS_ADVISE_BIG_PCLUSTER_1;
unsigned int clusterofs = ctx->clusterofs;
unsigned int count = e->length;
unsigned int bbits = sbi->blkszbits;
@@ -213,8 +214,7 @@ static void z_erofs_write_full_indexes(struct z_erofs_index_writer *ctx,
do {
advise = 0;
- /* XXX: big pcluster feature should be per-inode */
- if (d0 == 1 && erofs_sb_has_big_pcluster(sbi)) {
+ if (d0 == 1 && big_pcluster) {
type = Z_EROFS_LCLUSTER_TYPE_NONHEAD;
di.di_u.delta[0] = cpu_to_le16((e->plen >> bbits) |
Z_EROFS_LI_D0_CBLKCNT);
@@ -931,7 +931,7 @@ int z_erofs_convert_to_compact_format(struct erofs_inode *inode,
unsigned int compacted_4b_initial, compacted_4b_end;
unsigned int compacted_2b;
bool dummy_head;
- bool big_pcluster = erofs_sb_has_big_pcluster(sbi);
+ bool big_pcluster = inode->z_advise & Z_EROFS_ADVISE_BIG_PCLUSTER_1;
erofs_blk_t blkaddr;
if (logical_clusterbits < sbi->blkszbits)
--
2.47.3
next prev parent reply other threads:[~2026-09-15 6:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 6:21 [PATCH v2 1/4] erofs-utils: record algorithm id in in-memory compression extents Gao Xiang
2026-09-15 6:21 ` [PATCH v2 2/4] erofs-utils: lib: improve ztailinline fallback Gao Xiang
2026-09-15 6:21 ` Gao Xiang [this message]
2026-09-15 6:21 ` [PATCH v2 4/4] erofs-utils: mkfs: support rebuild mode for compressed inodes Gao Xiang
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=20260915062139.54810-3-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