[PATCH v7 2/2] erofs-utils: lib: add API to iterate dirs in EROFS
Gao Xiang
hsiangkao at linux.alibaba.com
Sat Dec 18 11:36:20 AEDT 2021
Hi Kelvin,
On Fri, Dec 17, 2021 at 02:54:09PM -0500, Kelvin Zhang wrote:
> Hi Gao,
> I drafted a new patchset on top of the dev branch. Changes since v6:
>
> 1. block buffer moved to the heap, due to stack size concerns when
> iterating recursively
> 2. Added a "recursive" option to input parameters
> 3. dname buffers are still on the heap, but allocation is done once per
> directory, instead of once for each directory entry.
> 4. Added a void* arg which will be forwarded to the callback function.
>
> I ran scripts/checkpatch.pl . Hopefully this makes your life easier. Thanks
> for the reply!.
>
>
Many thanks for your reply! I plan to take the patches in the
experimental branch.
The reason was written in include/erofs/dir.h:
https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/tree/include/erofs/dir.h?h=experimenta
erofs_dir_context can be allocated on heap (in summary, by
the caller) and chain together in order to avoid recursion
totally later. I think it should benefit Android scenario to
avoid stack overflow due to deep level as well.
Also Igor Eisberg sent a patch for a new get_pathname in the
erofs_dir_context reuse way:
https://lore.kernel.org/linux-erofs/CABjEcnE84FNBgiHFk6Q+V3d-4L-93bUFDkdfN4ftPX19kpC=ww@mail.gmail.com/
I plan to polish and apply them as well.
Thanks,
Gao Xiang
More information about the Linux-erofs
mailing list