[PATCH 0/4] erofs-utils: remove global sbi in library

Jingbo Xu jefflexu at linux.alibaba.com
Tue Jul 18 15:20:57 AEST 2023


Later mkfs is going to be capable of converting multiple erofs images
into one merged erofs image, in which case there are multiple device
context and sbi instances.

In preparation for that, remove global device context and sbi in all
libraries except buffer block library, as there's still only one output
erofs image.

The device context is inlined into sbi.  Each erofs_inode keeps a
reference to corresponding sbi through vi->sbi.  Global sbi is remained
but only used by utils directly, e.g. mkfs/dump/fsck.

patch 1-3 are minor fix/cleanup patches preparing for patch 4.

Test cases in "-b experimental-tests" passed with both 'make check' and
'make check FSTYP=erofsfuse'.

This series is also in reference to [1].

[1] https://lore.kernel.org/linux-erofs/20220909021816.10544-1-jnhuang@linux.alibaba.com/

Jingbo Xu (4):
  erofs-utils: simplify iloc()
  erofs-utils: lib: fix recursive erofs_iterate_dir()
  erofs-utils: inline vle_compressmeta_capacity()
  erofs-utils: remove global sbi in library

 dump/main.c                    |  30 +++---
 fsck/main.c                    |  41 ++++----
 fuse/main.c                    |  24 ++---
 include/erofs/blobchunk.h      |   4 +-
 include/erofs/cache.h          |   6 +-
 include/erofs/compress.h       |   8 +-
 include/erofs/compress_hints.h |   2 +-
 include/erofs/decompress.h     |   1 +
 include/erofs/dir.h            |   3 +-
 include/erofs/internal.h       |  59 ++++++-----
 include/erofs/io.h             |  38 +++----
 include/erofs/tar.h            |   4 +-
 include/erofs/xattr.h          |  16 +--
 lib/blobchunk.c                |  45 ++++-----
 lib/cache.c                    |  42 ++++----
 lib/compress.c                 | 175 +++++++++++++++++----------------
 lib/compress_hints.c           |  10 +-
 lib/compressor.c               |  15 +--
 lib/compressor.h               |   4 +-
 lib/compressor_lz4.c           |   2 +-
 lib/compressor_lz4hc.c         |   2 +-
 lib/data.c                     |  69 +++++++------
 lib/decompress.c               |  29 +++---
 lib/dir.c                      |  26 ++---
 lib/fragments.c                |   2 +-
 lib/inode.c                    | 118 ++++++++++++----------
 lib/io.c                       | 119 +++++++++++-----------
 lib/namei.c                    |  36 ++++---
 lib/super.c                    |  51 +++++-----
 lib/tar.c                      |  36 +++----
 lib/xattr.c                    |  75 +++++++-------
 lib/zmap.c                     |  43 ++++----
 mkfs/main.c                    |  62 ++++++------
 33 files changed, 632 insertions(+), 565 deletions(-)

-- 
2.19.1.6.gb485710b



More information about the Linux-erofs mailing list