linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] Remove hardcoded block size shifts
@ 2023-05-30 20:24 Kelvin Zhang via Linux-erofs
  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 ` [PATCH v1 1/2] Remove hardcoded block size shifts Gao Xiang
  0 siblings, 2 replies; 4+ messages in thread
From: Kelvin Zhang via Linux-erofs @ 2023-05-30 20:24 UTC (permalink / raw)
  To: linux-erofs mailing list, Miao Xie, Fang Wei; +Cc: Kelvin Zhang

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-30 23:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-30 20:24 [PATCH v1 1/2] Remove hardcoded block size shifts Kelvin Zhang via Linux-erofs
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

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).