From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3F4CFC433F5 for ; Wed, 2 Feb 2022 02:19:45 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4JpQVR3RFpz3bP9 for ; Wed, 2 Feb 2022 13:19:43 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.44; helo=out30-44.freemail.mail.aliyun.com; envelope-from=hsiangkao@linux.alibaba.com; receiver=) Received: from out30-44.freemail.mail.aliyun.com (out30-44.freemail.mail.aliyun.com [115.124.30.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4JpQVG4hVmz2yLP for ; Wed, 2 Feb 2022 13:19:31 +1100 (AEDT) X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R561e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04394; MF=hsiangkao@linux.alibaba.com; NM=1; PH=DS; RN=5; SR=0; TI=SMTPD_---0V3Q.FM2_1643768361; Received: from B-P7TQMD6M-0146(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0V3Q.FM2_1643768361) by smtp.aliyun-inc.com(127.0.0.1); Wed, 02 Feb 2022 10:19:23 +0800 Date: Wed, 2 Feb 2022 10:19:21 +0800 From: Gao Xiang To: Kelvin Zhang Subject: Re: [PATCH v1] erofs-utils: don't hard code constants Message-ID: References: <20220131184327.30176-1-zhangkelvin@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Miao Xie , linux-erofs mailing list Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" On Tue, Feb 01, 2022 at 02:44:46PM -0800, Kelvin Zhang wrote: > Thanks Gao! I'm reading compressed indices code recently. Is there any > notes/sketches/design docs you can share with me regarding that? > There are some kernel commit messages to describe the on-disk format: ec8c24420501d4cf3ed495c4d026984194897276 b86269f43892316ef5a177d7180d09d101a46f22 And Yue Hu wrote his own notes about compacted indexes (in Chinese): http://tjtech.me/erofs-compacted-index-generation.html Hope they are useful! I know that may not enough, I will try to write more this year. Thanks, Gao Xiang > Happy Chinese New Year! > > On Mon, Jan 31, 2022 at 6:51 PM Gao Xiang wrote: > > > > On Mon, Jan 31, 2022 at 10:43:27AM -0800, Kelvin Zhang wrote: > > > Use sizeof(z_erofs_vle_decompressed_index) to compute legacy index count > > > > > > Test: th > > > Signed-off-by: Kelvin Zhang > > > --- > > > lib/compress.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/lib/compress.c b/lib/compress.c > > > index 98be7a2..c520a1e 100644 > > > --- a/lib/compress.c > > > +++ b/lib/compress.c > > > @@ -359,7 +359,7 @@ int z_erofs_convert_to_compacted_format(struct erofs_inode *inode, > > > inode->xattr_isize) + > > > sizeof(struct z_erofs_map_header); > > > const unsigned int totalidx = (legacymetasize - > > > - Z_EROFS_LEGACY_MAP_HEADER_SIZE) / 8; > > > + Z_EROFS_LEGACY_MAP_HEADER_SIZE) / sizeof(struct z_erofs_vle_decompressed_index); > > > > It would be better to keep 80-char limit rule. > > > > Thanks, applied. > > > > Happy chinese new year! > > Gao Xiang > > > > > const unsigned int logical_clusterbits = inode->z_logical_clusterbits; > > > u8 *out, *in; > > > struct z_erofs_compressindex_vec cv[16]; > > > -- > > > 2.35.0.rc2.247.g8bbb082509-goog > > > > -- > Sincerely, > > Kelvin Zhang