From: Andrew Price <anprice@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 00/18] gfs2-utils: Don't require an external print_it() in libgfs2
Date: Wed, 12 Jan 2022 19:26:32 +0000 [thread overview]
Message-ID: <20220112192650.1426415-1-anprice@redhat.com> (raw)
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
--
2.34.1
next reply other threads:[~2022-01-12 19:26 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-12 19:26 Andrew Price [this message]
2022-01-12 19:26 ` [Cluster-devel] [PATCH 01/18] libgfs2: Move debugging printf out of build_master() Andrew Price
2022-01-12 19:26 ` [Cluster-devel] [PATCH 02/18] libgfs2: Rework lgfs2_build_jindex() Andrew Price
2022-01-12 19:26 ` [Cluster-devel] [PATCH 03/18] libgfs2: Move build_jindex() into fsck.gfs2 Andrew Price
2022-01-12 19:26 ` [Cluster-devel] [PATCH 04/18] libgfs2: Push down build_per_node() into the utils Andrew Price
2022-01-12 19:26 ` [Cluster-devel] [PATCH 05/18] libgfs2: Return the inode from build_inum_range() Andrew Price
2022-01-12 19:26 ` [Cluster-devel] [PATCH 06/18] libgfs2: Return the inode from build_statfs_change() Andrew Price
2022-01-12 19:26 ` [Cluster-devel] [PATCH 07/18] libgfs2: Return the inode from build_quota_change() Andrew Price
2022-01-12 19:26 ` [Cluster-devel] [PATCH 08/18] libgfs2: Return the inode from build_inum() Andrew Price
2022-01-12 19:26 ` [Cluster-devel] [PATCH 09/18] libgfs2: Return the inode from build_statfs() Andrew Price
2022-01-12 19:26 ` [Cluster-devel] [PATCH 10/18] libgfs2: Return the inode from build_rindex() Andrew Price
2022-01-12 19:26 ` [Cluster-devel] [PATCH 11/18] libgfs2: Return the inode from build_quota() Andrew Price
2022-01-12 19:26 ` [Cluster-devel] [PATCH 12/18] libgfs2: Move debugging printf out of build_root() Andrew Price
2022-01-12 19:26 ` [Cluster-devel] [PATCH 13/18] libgfs2: Remove debugging printf from do_init_statfs() Andrew Price
2022-01-12 19:26 ` [Cluster-devel] [PATCH 14/18] libgfs2: Move debugging output out of do_init_inum() Andrew Price
2022-01-12 19:26 ` [Cluster-devel] [PATCH 15/18] libgfs2: Remove debugging printfs from fix_device_geometry() Andrew Price
2022-01-12 19:26 ` [Cluster-devel] [PATCH 16/18] libgfs2: Remove config.[ch] Andrew Price
2022-01-12 19:26 ` [Cluster-devel] [PATCH 17/18] libgfs2: Move struct printing functions out of libgfs2 Andrew Price
2022-01-12 19:26 ` [Cluster-devel] [PATCH 18/18] libgfs2: Remove print_it extern requirement Andrew Price
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220112192650.1426415-1-anprice@redhat.com \
--to=anprice@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).