[PATCH] erofs: fix file-backed mounts over FUSE

Gao Xiang hsiangkao at linux.alibaba.com
Thu Nov 14 17:38:46 AEDT 2024



On 2024/11/14 14:34, Al Viro wrote:
> On Thu, Nov 14, 2024 at 02:23:27PM +0800, Gao Xiang wrote:
> 
>>> 3) AFAICS, (buf->kmap_type == EROFS_KMAP) == (buf->base != NULL).  What's
>>> the point of having that as a separate field?
>>
>> Once buf->kmap_type has EROFS_KMAP and EROFS_KMAP_ATOMIC, but it
>> seems that it can be cleaned up now.
>>
>> I will clean up later but it's a seperate story.
>>
>>>
>>> 4) Why bother with union?  Just have buf->file serve as your buf->use_fp
>>> and be done with that...
>>
>> I'd like to leave `struct erofs_buf` as small as possible since
>> it's on stack.
> 
> enum + bool eats at least as much as a pointer, and if it's on stack...
> an extra word is really noise - it's not as if you had a plenty of
> those in the current call chain at any given point.

Yeah, enum can be avoided now, I will clean up this enum
as a seperate effort.

Thanks,
Gao Xiang



More information about the Linux-erofs mailing list