From: Gao Xiang <xiang@kernel.org>
To: linux-erofs@lists.ozlabs.org
Cc: Gao Xiang <xiang@kernel.org>
Subject: [PATCH v3 3/4] erofs-utils: lib: switch to use per-inode big pcluster flag
Date: Wed, 16 Sep 2026 15:41:00 +0800 [thread overview]
Message-ID: <20260916074101.66357-3-xiang@kernel.org> (raw)
In-Reply-To: <20260916074101.66357-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-16 7:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 7:40 [PATCH v3 1/4] erofs-utils: record algorithm id in in-memory compression extents Gao Xiang
2026-09-16 7:40 ` [PATCH v3 2/4] erofs-utils: lib: improve ztailinline fallback Gao Xiang
2026-09-16 7:41 ` Gao Xiang [this message]
2026-09-16 7:41 ` [PATCH v3 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=20260916074101.66357-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.