linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Kelvin Zhang via Linux-erofs <linux-erofs@lists.ozlabs.org>
To: linux-erofs mailing list <linux-erofs@lists.ozlabs.org>,
	Miao Xie <miaoxie@huawei.com>,  Fang Wei <fangwei1@huawei.com>
Cc: Kelvin Zhang <zhangkelvin@google.com>
Subject: [PATCH v1 1/2] Remove hardcoded block size shifts
Date: Tue, 30 May 2023 13:24:12 -0700	[thread overview]
Message-ID: <20230530202413.2734743-1-zhangkelvin@google.com> (raw)

This improves support for non 4K block sizes

Signed-off-by: Kelvin Zhang <zhangkelvin@google.com>
---
 lib/compress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/compress.c b/lib/compress.c
index 06bacdb..ae0838c 100644
--- a/lib/compress.c
+++ b/lib/compress.c
@@ -766,7 +766,7 @@ static void z_erofs_write_mapheader(struct erofs_inode *inode,
 		.h_algorithmtype = inode->z_algorithmtype[1] << 4 |
 				   inode->z_algorithmtype[0],
 		/* lclustersize */
-		.h_clusterbits = inode->z_logical_clusterbits - 12,
+		.h_clusterbits = inode->z_logical_clusterbits - sbi.blkszbits,
 	};
 
 	if (inode->z_advise & Z_EROFS_ADVISE_FRAGMENT_PCLUSTER)
-- 
2.41.0.rc0.172.g3f132b7071-goog


             reply	other threads:[~2023-05-30 20:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30 20:24 Kelvin Zhang via Linux-erofs [this message]
2023-05-30 20:24 ` [PATCH v1 2/2] Allow developer to manually set a max block size Kelvin Zhang via Linux-erofs
2023-05-30 23:51   ` Gao Xiang
2023-05-30 23:51 ` [PATCH v1 1/2] Remove hardcoded block size shifts 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=20230530202413.2734743-1-zhangkelvin@google.com \
    --to=linux-erofs@lists.ozlabs.org \
    --cc=fangwei1@huawei.com \
    --cc=miaoxie@huawei.com \
    --cc=zhangkelvin@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).