<div dir="ltr">Sounds good, now that v1.4 is available on kernel.lorg, shall we start working on the refactoring commits?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Nov 21, 2021 at 2:31 AM Gao Xiang <<a href="mailto:hsiangkao@linux.alibaba.com">hsiangkao@linux.alibaba.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Kelvin,<br>
<br>
On Sat, Nov 20, 2021 at 09:39:17PM -0800, Kelvin Zhang wrote:<br>
> EROFS-utils contains several usage of global variables, namely<br>
> <br>
> 1. int erofs_devfd, stores the file descriptor to open'ed block devices.<br>
> This is referened in many places.<br>
> 2. struct erofs_sb_info sbi; Stores parsed super block.<br>
> <br>
> These global variables make embedding erofs library diffcult. To make<br>
> library usage easier, a series of 3 patches are drafted to refactor away<br>
> the global variables. Each patch has been built and tested by calling<br>
> mkfs.erofs and ensure the same output is generated.<br>
<br>
Agreed, that is mainly due to fast iterative development. If we consider<br>
to export liberofs as a real library, these all needs to be resolved in<br>
advance, and it'd be better to stablize all liberofs APIs as well.<br>
<br>
However, let's postpone this work until 1.4 is out, I have to admit I'm<br>
a bit delay of releasing v1.4 due to my busy work.<br>
Now I'm working on pre-releasing..<br>
<br>
Thanks,<br>
Gao Xiang<br>
<br>
> <br>
> Kelvin Zhang (3):<br>
> Make erofs_devfd a parameter for most functions<br>
> Mark certain callback function pointers as const<br>
> Make super block info struct a paramater instead of globals<br>
> <br>
> Android.bp | 44 +++++++-<br>
> dump/main.c | 84 ++++++++------<br>
> fsck/main.c | 90 +++++++++------<br>
> fuse/dir.c | 8 +-<br>
> fuse/main.c | 19 ++--<br>
> include/erofs/blobchunk.h | 7 +-<br>
> include/erofs/cache.h | 15 +--<br>
> include/erofs/compress.h | 10 +-<br>
> include/erofs/config.h | 15 +--<br>
> include/erofs/decompress.h | 5 +-<br>
> include/erofs/defs.h | 21 ++++<br>
> include/erofs/inode.h | 9 +-<br>
> include/erofs/internal.h | 72 ++++++------<br>
> include/erofs/io.h | 48 +++++---<br>
> include/erofs/iterate.h | 35 ++++++<br>
> include/erofs/xattr.h | 2 +-<br>
> iterate/main.c | 51 +++++++++<br>
> lib/blobchunk.c | 11 +-<br>
> lib/cache.c | 33 +++---<br>
> lib/compress.c | 104 ++++++++++-------<br>
> lib/compressor.c | 9 +-<br>
> lib/compressor.h | 13 ++-<br>
> lib/compressor_liblzma.c | 4 +-<br>
> lib/compressor_lz4.c | 8 +-<br>
> lib/compressor_lz4hc.c | 6 +-<br>
> lib/config.c | 64 ++++++-----<br>
> lib/data.c | 54 +++++----<br>
> lib/decompress.c | 12 +-<br>
> lib/inode.c | 129 ++++++++++++---------<br>
> lib/io.c | 74 ++++++------<br>
> lib/iterate.c | 223 +++++++++++++++++++++++++++++++++++++<br>
> lib/namei.c | 44 +++++---<br>
> lib/super.c | 28 ++---<br>
> lib/xattr.c | 10 +-<br>
> lib/zmap.c | 92 +++++++++------<br>
> mkfs/main.c | 92 +++++++--------<br>
> 36 files changed, 1069 insertions(+), 476 deletions(-)<br>
> create mode 100644 include/erofs/iterate.h<br>
> create mode 100644 iterate/main.c<br>
> create mode 100644 lib/iterate.c<br>
> <br>
> -- <br>
> 2.34.0.rc2.393.gf8c9666880-goog<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Sincerely,<div><br></div><div>Kelvin Zhang</div></div></div>