This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch andyp-sparse
in repository gfs2-utils.
commit c10073cbe4b91653cfe128b00c6ab9a7f6808a4c
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Apr 21 17:32:18 2021 +0100
libgfs2: Add a function for printing on-disk meta headers
The existing gfs2_meta_header_print() function assumes the structure has
native-endian fields. Add a function which assumes they are big-endian
so that we can avoid intermediate whole-struct conversions.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/libgfs2.h | 2 ++
gfs2/libgfs2/ondisk.c | 9 +++++++++
2 files changed, 11 insertions(+)
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 3f36ffb2..8c49d150 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -738,6 +738,8 @@ extern void gfs2_log_header_print(const struct gfs2_log_header *lh);
extern void gfs2_log_descriptor_print(const struct gfs2_log_descriptor *ld);
extern void gfs2_statfs_change_print(const struct gfs2_statfs_change *sc);
extern void gfs2_quota_change_print(const struct gfs2_quota_change *qc);
+/* These expect on-disk data instead of native-endian structs */
+extern void lgfs2_meta_header_print(void *mhp);
__END_DECLS
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index ca399736..c4ce16b1 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -97,6 +97,15 @@ void gfs2_meta_header_print(const struct gfs2_meta_header *mh)
pv(mh, mh_format, "%"PRIu32, "0x%"PRIx32);
}
+void lgfs2_meta_header_print(void *mhp)
+{
+ struct gfs2_meta_header *mh = mhp;
+
+ print_it(" mh_magic", "0x%08"PRIX32, NULL,
be32_to_cpu(mh->mh_magic));
+ printbe32(mh, mh_type);
+ printbe32(mh, mh_format);
+}
+
void gfs2_sb_in(struct gfs2_sb *sb, char *buf)
{
struct gfs2_sb *str = (struct gfs2_sb *)buf;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date