[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YR924TIIgLzJx0Ok@B-P7TQMD6M-0146.local>
Date: Fri, 20 Aug 2021 17:33:21 +0800
From: Gao Xiang <hsiangkao@...ux.alibaba.com>
To: Chao Yu <chao@...nel.org>
Cc: linux-erofs@...ts.ozlabs.org, Liu Bo <bo.liu@...ux.alibaba.com>,
LKML <linux-kernel@...r.kernel.org>,
Peng Tao <tao.peng@...ux.alibaba.com>,
Eryu Guan <eguan@...ux.alibaba.com>,
Liu Jiang <gerry@...ux.alibaba.com>,
Joseph Qi <joseph.qi@...ux.alibaba.com>,
Tao Ma <boyu.mt@...bao.com>
Subject: Re: [PATCH v2 2/2] erofs: support reading chunk-based uncompressed
files
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@...nel.org>
> > >
> >
> > Thanks for the review!
> >
> > Thanks,
> > Gao Xiang
> >
> > > Thanks,
> > >
Powered by blists - more mailing lists