All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] Make erofs-utils more library friendly
@ 2021-11-21  5:39 Kelvin Zhang via Linux-erofs
  2021-11-21  5:39 ` [PATCH v1 1/4] Make erofs_devfd a parameter for most functions Kelvin Zhang via Linux-erofs
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Kelvin Zhang via Linux-erofs @ 2021-11-21  5:39 UTC (permalink / raw)
  To: linux-erofs mailing list, Li Guifu, Miao Xie, Fang Wei
  Cc: Kelvin Zhang, Chao Yu

EROFS-utils contains several usage of global variables, namely

1. int erofs_devfd, stores the file descriptor to open'ed block devices.
This is referened in many places.
2. struct erofs_sb_info sbi; Stores parsed super block.

These global variables make embedding erofs library diffcult. To make
library usage easier, a series of 3 patches are drafted to refactor away
the global variables. Each patch has been built and tested by calling
mkfs.erofs and ensure the same output is generated.

Kelvin Zhang (3):
  Make erofs_devfd a parameter for most functions
  Mark certain callback function pointers as const
  Make super block info struct a paramater instead of globals

 Android.bp                 |  44 +++++++-
 dump/main.c                |  84 ++++++++------
 fsck/main.c                |  90 +++++++++------
 fuse/dir.c                 |   8 +-
 fuse/main.c                |  19 ++--
 include/erofs/blobchunk.h  |   7 +-
 include/erofs/cache.h      |  15 +--
 include/erofs/compress.h   |  10 +-
 include/erofs/config.h     |  15 +--
 include/erofs/decompress.h |   5 +-
 include/erofs/defs.h       |  21 ++++
 include/erofs/inode.h      |   9 +-
 include/erofs/internal.h   |  72 ++++++------
 include/erofs/io.h         |  48 +++++---
 include/erofs/iterate.h    |  35 ++++++
 include/erofs/xattr.h      |   2 +-
 iterate/main.c             |  51 +++++++++
 lib/blobchunk.c            |  11 +-
 lib/cache.c                |  33 +++---
 lib/compress.c             | 104 ++++++++++-------
 lib/compressor.c           |   9 +-
 lib/compressor.h           |  13 ++-
 lib/compressor_liblzma.c   |   4 +-
 lib/compressor_lz4.c       |   8 +-
 lib/compressor_lz4hc.c     |   6 +-
 lib/config.c               |  64 ++++++-----
 lib/data.c                 |  54 +++++----
 lib/decompress.c           |  12 +-
 lib/inode.c                | 129 ++++++++++++---------
 lib/io.c                   |  74 ++++++------
 lib/iterate.c              | 223 +++++++++++++++++++++++++++++++++++++
 lib/namei.c                |  44 +++++---
 lib/super.c                |  28 ++---
 lib/xattr.c                |  10 +-
 lib/zmap.c                 |  92 +++++++++------
 mkfs/main.c                |  92 +++++++--------
 36 files changed, 1069 insertions(+), 476 deletions(-)
 create mode 100644 include/erofs/iterate.h
 create mode 100644 iterate/main.c
 create mode 100644 lib/iterate.c

-- 
2.34.0.rc2.393.gf8c9666880-goog


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-11-23  7:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-21  5:39 [PATCH v1 0/3] Make erofs-utils more library friendly Kelvin Zhang via Linux-erofs
2021-11-21  5:39 ` [PATCH v1 1/4] Make erofs_devfd a parameter for most functions Kelvin Zhang via Linux-erofs
2021-11-23  7:49   ` Gao Xiang
2021-11-21  5:39 ` [PATCH v1 2/4] Mark certain callback function pointers as const Kelvin Zhang via Linux-erofs
2021-11-21  5:39 ` [PATCH v1 3/4] Make super block info struct a paramater instead of globals Kelvin Zhang via Linux-erofs
2021-11-23  7:54   ` Gao Xiang
2021-11-21 10:31 ` [PATCH v1 0/3] Make erofs-utils more library friendly Gao Xiang
2021-11-23  7:39   ` Kelvin Zhang via Linux-erofs

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.