From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Chao Yu <chao@kernel.org>
Cc: Tao Ma <boyu.mt@taobao.com>, LKML <linux-kernel@vger.kernel.org>,
Peng Tao <tao.peng@linux.alibaba.com>,
Joseph Qi <joseph.qi@linux.alibaba.com>,
Liu Bo <bo.liu@linux.alibaba.com>,
Eryu Guan <eguan@linux.alibaba.com>,
Liu Jiang <gerry@linux.alibaba.com>,
linux-erofs@lists.ozlabs.org
Subject: Re: [PATCH v2 2/2] erofs: support reading chunk-based uncompressed files
Date: Fri, 20 Aug 2021 17:33:21 +0800 [thread overview]
Message-ID: <YR924TIIgLzJx0Ok@B-P7TQMD6M-0146.local> (raw)
In-Reply-To: <f501144f-f7fc-1150-0c41-4c1981bd0594@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 <chao@kernel.org>
> > >
> >
> > Thanks for the review!
> >
> > Thanks,
> > Gao Xiang
> >
> > > Thanks,
> > >
next prev parent reply other threads:[~2021-08-20 9:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-18 7:07 [PATCH 1/2] erofs: introduce chunk-based file on-disk format Gao Xiang
2021-08-18 7:07 ` [PATCH 2/2] erofs: support reading chunk-based uncompressed files Gao Xiang
2021-08-18 22:29 ` Liu Bo
2021-08-19 3:46 ` Chao Yu
2021-08-19 5:14 ` Gao Xiang
2021-08-18 22:28 ` [PATCH 1/2] erofs: introduce chunk-based file on-disk format Liu Bo
2021-08-19 0:59 ` Gao Xiang
2021-08-19 3:32 ` Chao Yu
2021-08-19 6:33 ` [PATCH v2 " Gao Xiang
2021-08-19 6:33 ` [PATCH v2 2/2] erofs: support reading chunk-based uncompressed files Gao Xiang
2021-08-19 6:37 ` Joseph Qi
2021-08-19 7:12 ` Gao Xiang
2021-08-20 9:04 ` Chao Yu
2021-08-20 9:12 ` Gao Xiang
2021-08-20 9:29 ` Chao Yu
2021-08-20 9:33 ` Gao Xiang [this message]
2021-08-20 10:00 ` [PATCH v3 1/2] erofs: introduce chunk-based file on-disk format Gao Xiang
2021-08-20 10:00 ` [PATCH v3 2/2] erofs: support reading chunk-based uncompressed files 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=YR924TIIgLzJx0Ok@B-P7TQMD6M-0146.local \
--to=hsiangkao@linux.alibaba.com \
--cc=bo.liu@linux.alibaba.com \
--cc=boyu.mt@taobao.com \
--cc=chao@kernel.org \
--cc=eguan@linux.alibaba.com \
--cc=gerry@linux.alibaba.com \
--cc=joseph.qi@linux.alibaba.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tao.peng@linux.alibaba.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).