[PATCH 2/2] erofs-utils: refactor: remove end argument from erofs_mapbh

Gao Xiang hsiangkao at redhat.com
Sat Jan 2 20:27:50 AEDT 2021

On Sat, Jan 02, 2021 at 06:00:06AM +0000, 胡 玮文 wrote:
> Hi Xiang,
> If I understand it correctly, when ‘end == false’, the last buffer block will not get its ‘blkaddr’. I can’t see why we need this, but I might be missing something. And every invocation of this function just pass ‘true’ to this argument. I’m intended to remove some dead code which is never invoked.

Yeah, your understanding is correct. The original purpose when 'end == false' was to
return the start blkaddr of a buffer block in case of (or reserve for) later use (e.g.
get the blkaddr of a inode or some data block that will need). and 'end == true' was
to return the tail blkaddr.... But, I think the behavior of 'end == false' was
completely broken at some time...

> > 在 2021年1月2日,13:15,Gao Xiang <hsiangkao at redhat.com> 写道:
> > 
> > Hi Weiwen,
> > 
> >> On Fri, Jan 01, 2021 at 05:11:58PM +0800, 胡玮文 wrote:
> >> Signed-off-by: Hu Weiwen <huww98 at outlook.com>
> > 
> > It seems that it drops the needed argument `end'.
> > 
> > The original purpose of that is to get the beginning/end blkaddr of a buffer block
> > in preparation for later use, some specific reasons to get rid of it?
> > (also it only drops one extra line considering the diffstat....)
> That’s because I already assumed ‘end == true’ and rewritten this function in [PATCH 1/2]

Ok, let me seek some time read into it :) the complexity issue of buffer allocation
is a known issue and can be optimized by some caching (Although Android don't have
too many files) :)

Gao Xiang

> Thanks for your reply.
> Hu Weiwen
> > 
> > Thanks,
> > Gao Xiang

More information about the Linux-erofs mailing list