Skip to content

gfs2-utils: Don't require an external print_it() in libgfs2

Andrew Price cluster-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest18 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18libgfs2: Move debugging printf out of build_master()gfs2/libgfs2/structures.c gfs2/mkfs/main_mkfs.c+4 -40 replies
2/18libgfs2: Rework lgfs2_build_jindex()gfs2/libgfs2/libgfs2.h gfs2/libgfs2/structures.c gfs2/mkfs/main_mkfs.c+31 -210 replies
3/18libgfs2: Move build_jindex() into fsck.gfs2gfs2/fsck/fs_recovery.c gfs2/fsck/fs_recovery.h gfs2/fsck/pass2.c +2 more+23 -300 replies
4/18libgfs2: Push down build_per_node() into the utilsgfs2/convert/gfs2_convert.c gfs2/fsck/fsck.h gfs2/fsck/pass1.c +3 more+117 -420 replies
5/18libgfs2: Return the inode from build_inum_range()gfs2/convert/gfs2_convert.c gfs2/fsck/pass1.c gfs2/fsck/pass2.c +3 more+42 -220 replies
6/18libgfs2: Return the inode from build_statfs_change()gfs2/convert/gfs2_convert.c gfs2/fsck/pass1.c gfs2/fsck/pass2.c +3 more+36 -220 replies
7/18libgfs2: Return the inode from build_quota_change()gfs2/convert/gfs2_convert.c gfs2/fsck/pass1.c gfs2/fsck/pass2.c +3 more+33 -270 replies
8/18libgfs2: Return the inode from build_inum()gfs2/convert/gfs2_convert.c gfs2/fsck/initialize.c gfs2/fsck/pass1.c +3 more+33 -330 replies
9/18libgfs2: Return the inode from build_statfs()gfs2/convert/gfs2_convert.c gfs2/fsck/initialize.c gfs2/fsck/pass1.c +3 more+30 -270 replies
10/18libgfs2: Return the inode from build_rindex()gfs2/convert/gfs2_convert.c gfs2/fsck/initialize.c gfs2/fsck/pass1.c +3 more+40 -260 replies
11/18libgfs2: Return the inode from build_quota()gfs2/convert/gfs2_convert.c gfs2/fsck/initialize.c gfs2/fsck/pass1.c +3 more+37 -270 replies
12/18libgfs2: Move debugging printf out of build_root()gfs2/libgfs2/structures.c gfs2/mkfs/main_mkfs.c+4 -40 replies
13/18libgfs2: Remove debugging printf from do_init_statfs()gfs2/convert/gfs2_convert.c gfs2/fsck/initialize.c gfs2/fsck/main.c +3 more+13 -110 replies
14/18libgfs2: Move debugging output out of do_init_inum()gfs2/libgfs2/structures.c gfs2/mkfs/main_mkfs.c+3 -30 replies
15/18libgfs2: Remove debugging printfs from fix_device_geometry()gfs2/libgfs2/device_geometry.c+0 -60 replies
16/18libgfs2: Remove config.[ch]gfs2/libgfs2/Makefile.am gfs2/libgfs2/checks.am gfs2/libgfs2/config.c +6 more+0 -250 replies
17/18libgfs2: Move struct printing functions out of libgfs2gfs2/edit/Makefile.am gfs2/edit/extended.c gfs2/edit/gfs2hex.c +9 more+496 -2520 replies
18/18libgfs2: Remove print_it extern requirementgfs2/convert/gfs2_convert.c gfs2/edit/extended.c gfs2/edit/gfs2hex.c +12 more+198 -2460 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Cluster-devel] [PATCH 00/18] gfs2-utils: Don't require an external print_it() in libgfs2

This patch set fixes a long-standing issue in libgfs2 where it requires apps linking to it to provide a print_it function, which it uses in lgfs2_(struct)_print() functions defined in libgfs2/ondisk.c. This was the main blocker to it becoming a library in a more meaningful sense.

The approach taken is to remove the responsibility of printing gfs2 structures from libgfs2 altogether. So the first challenge is to remove debugging output from libgfs2 and push it down into the utils, which in turn required returning more context from some libgfs2 functions, mainly the build_* functions in structures.c.

The overall result is more flexibility and control over the way the utils print on-disk structures and improved error/debug messages. Test code is also tidied up as we no longer have to define a print_it() in each of the tests.

Andrew Price (18):
libgfs2: Move debugging printf out of build_master()
libgfs2: Rework lgfs2_build_jindex()
libgfs2: Move build_jindex() into fsck.gfs2
libgfs2: Push down build_per_node() into the utils
libgfs2: Return the inode from build_inum_range()
libgfs2: Return the inode from build_statfs_change()
libgfs2: Return the inode from build_quota_change()
libgfs2: Return the inode from build_inum()
libgfs2: Return the inode from build_statfs()
libgfs2: Return the inode from build_rindex()
libgfs2: Return the inode from build_quota()
libgfs2: Move debugging printf out of build_root()
libgfs2: Remove debugging printf from do_init_statfs()
libgfs2: Move debugging output out of do_init_inum()
libgfs2: Remove debugging printfs from fix_device_geometry()
libgfs2: Remove config.[ch]
libgfs2: Move struct printing functions out of libgfs2
libgfs2: Remove print_it extern requirement

 gfs2/convert/gfs2_convert.c    |  80 +++++---
 gfs2/edit/Makefile.am          |   2 +
 gfs2/edit/extended.c           |  18 +-
 gfs2/edit/gfs2hex.c            | 156 +-------------
 gfs2/edit/hexedit.c            |  36 +---
 gfs2/edit/hexedit.h            |   4 +-
 gfs2/edit/struct_print.c       | 364 +++++++++++++++++++++++++++++++++
 gfs2/edit/struct_print.h       |  23 +++
 gfs2/fsck/fs_recovery.c        |  21 ++
 gfs2/fsck/fs_recovery.h        |   1 +
 gfs2/fsck/fsck.h               |   1 +
 gfs2/fsck/initialize.c         |  75 +++----
 gfs2/fsck/main.c               |  13 +-
 gfs2/fsck/pass1.c              |  86 +++++++-
 gfs2/fsck/pass2.c              |  37 +++-
 gfs2/glocktop/glocktop.c       |   3 +-
 gfs2/libgfs2/Makefile.am       |   2 -
 gfs2/libgfs2/check_libgfs2.c   |   3 -
 gfs2/libgfs2/checks.am         |   1 -
 gfs2/libgfs2/config.c          |   9 -
 gfs2/libgfs2/config.h          |   6 -
 gfs2/libgfs2/device_geometry.c |   7 -
 gfs2/libgfs2/gfs2l.c           |   3 -
 gfs2/libgfs2/libgfs2.h         |  40 +---
 gfs2/libgfs2/ondisk.c          | 199 ------------------
 gfs2/libgfs2/structures.c      | 226 ++++----------------
 gfs2/mkfs/Makefile.am          |   2 +
 gfs2/mkfs/gfs2_mkfs.h          |  11 -
 gfs2/mkfs/main_jadd.c          |   1 -
 gfs2/mkfs/main_mkfs.c          | 152 +++++++++++---
 gfs2/mkfs/struct_print.c       | 218 ++++++++++++++++++++
 gfs2/mkfs/struct_print.h       |  19 ++
 tests/nukerg.c                 |   3 -
 33 files changed, 1067 insertions(+), 755 deletions(-)
 create mode 100644 gfs2/edit/struct_print.c
 create mode 100644 gfs2/edit/struct_print.h
 delete mode 100644 gfs2/libgfs2/config.c
 delete mode 100644 gfs2/libgfs2/config.h
 create mode 100644 gfs2/mkfs/struct_print.c
 create mode 100644 gfs2/mkfs/struct_print.h
Signature · 1 line
2.34.1