Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1302042pxb; Fri, 20 Aug 2021 02:37:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2mRqRy9c+PJcw5kmwkUppb9aORakdRjgqvig0Ln2XD9Kvj39kwO1SC9DXW7rQc/lG8P2t X-Received: by 2002:a05:6402:430d:: with SMTP id m13mr21082891edc.372.1629452235261; Fri, 20 Aug 2021 02:37:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629452235; cv=none; d=google.com; s=arc-20160816; b=pjB8l2C3LeQZiJJyxkncoEIRYEoypiFIyvQBHL4y0YjrvASG+dEOzbMU14ir8b8gKc ByMRSNN/IVxR2mUfzfgUxSf6QZXOpVC66yab1dTzQaIjHpLIV5dC7k5ogIJ7eFdgM+bP lz6xYdnGVbeh/zTnyRHmrXMxiNr8RPVMJkRnvG+EyAlynUgjuVyGoPJgvab9u0ftCxVl iXV+IoZqyUlqDfpdIBfJP0h4fUEB54ZiQOYmK+R1ambl6zoe/ubC/bzGFfbiR8GFEfoa z21v2ZfR+etNIJGZ1mD8NRf3j+BW6g+vzt76D6jWFOHq+JyK7M/+AO8Kfxw6RtPDPXzg aHwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=GzCKNyvPnZkZcUXpopyxnHZu/cqgcvMS7TgwaLKbY1Y=; b=psP0C1LmiBOQJu1gmZXYQsCL/ePFHbzsYag2J7O0xMeEJ9kLRxpIGfU/Z5sWQdAuxl OspVIdi1O5fOhrOHTNZgJ/pnL1j/LfTCBq7wLTsY7nqbiQvu7FXwziKcLhmpPKqhH89Z FhEr7rZSolx6ZAhl7r5wFbUl9kbITgX9H6qe9wHlCou9dtc5nfgxiJVljCgZK6wy3cZC 5bmdAxLN7ahuE5q/534aoGA32kckcuoLJKNSNiJpkJVDPAaSgTK5GRWB28nMWzqHRQ0D IPgmIFrxk5RMmuVIBNJEsGLD4dlthJhHAS+9v11aDVlaAH93VMvEV7fQNZa/E5oxskyX Hjgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v27si5739838ejg.148.2021.08.20.02.36.52; Fri, 20 Aug 2021 02:37:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236293AbhHTJeD (ORCPT + 99 others); Fri, 20 Aug 2021 05:34:03 -0400 Received: from out30-54.freemail.mail.aliyun.com ([115.124.30.54]:46656 "EHLO out30-54.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235313AbhHTJeC (ORCPT ); Fri, 20 Aug 2021 05:34:02 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R451e4;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=9;SR=0;TI=SMTPD_---0UkJoTcw_1629452002; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0UkJoTcw_1629452002) by smtp.aliyun-inc.com(127.0.0.1); Fri, 20 Aug 2021 17:33:23 +0800 Date: Fri, 20 Aug 2021 17:33:21 +0800 From: Gao Xiang To: Chao Yu Cc: linux-erofs@lists.ozlabs.org, Liu Bo , LKML , Peng Tao , Eryu Guan , Liu Jiang , Joseph Qi , Tao Ma Subject: Re: [PATCH v2 2/2] erofs: support reading chunk-based uncompressed files Message-ID: References: <20210818070713.4437-1-hsiangkao@linux.alibaba.com> <20210819063310.177035-1-hsiangkao@linux.alibaba.com> <20210819063310.177035-2-hsiangkao@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 20, 2021 at 05:29:36PM +0800, Chao Yu wrote: > On 2021/8/20 17:12, Gao Xiang wrote: > > Hi Chao, > > > > On Fri, Aug 20, 2021 at 05:04:13PM +0800, Chao Yu wrote: > > > On 2021/8/19 14:33, Gao Xiang wrote: > > > > ... > > > > > > } > > > > +static int erofs_map_blocks(struct inode *inode, > > > > + struct erofs_map_blocks *map, int flags) > > > > +{ > > > > + struct super_block *sb = inode->i_sb; > > > > + struct erofs_inode *vi = EROFS_I(inode); > > > > + struct erofs_inode_chunk_index *idx; > > > > + struct page *page; > > > > + u64 chunknr; > > > > + unsigned int unit; > > > > + erofs_off_t pos; > > > > + int err = 0; > > > > + > > > > + if (map->m_la >= inode->i_size) { > > > > + /* leave out-of-bound access unmapped */ > > > > + map->m_flags = 0; > > > > + map->m_plen = 0; > > > > + goto out; > > > > + } > > > > + > > > > + if (vi->datalayout != EROFS_INODE_CHUNK_BASED) > > > > + return erofs_map_blocks_flatmode(inode, map, flags); > > > > + > > > > + if (vi->chunkformat & EROFS_CHUNK_FORMAT_INDEXES) > > > > + unit = sizeof(*idx); /* chunk index */ > > > > + else > > > > + unit = 4; /* block map */ > > > > > > You mean sizeof(__le32)? > > > > Yeah, sizeof(__le32) == 4, either way works for me. > > > > If some tendency about this, I will update when applying. > > Xiang, > > Yeah, I preper: > > #define EROFS_BLOCK_MAP_ENTRY_SIZE sizeof(__le32) > > unit = EROFS_BLOCK_MAP_ENTRY_SIZE; > > to improve readablity, but unit = sizeof(__le32) is fine as well. Ok, looks much better, let me revise v3 here. Thanks, Gao Xiang > > Thanks, > > > > > > > > > Otherwise it looks good to me. > > > > > > Reviewed-by: Chao Yu > > > > > > > Thanks for the review! > > > > Thanks, > > Gao Xiang > > > > > Thanks, > > >