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 f42aeb72838d24e14685c8edc41db5afa9f20464
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Apr 21 17:39:11 2021 +0100
libgfs2: Expect big-endian data when printing log descriptors
Replace gfs2_log_descriptor_print() with a function that accepts
big-endian data instead of a struct that has been pre-converted.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/gfs2hex.c | 4 +---
gfs2/libgfs2/libgfs2.h | 2 +-
gfs2/libgfs2/ondisk.c | 14 ++++++++------
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index 5e79009a..dc748c52 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -455,7 +455,6 @@ int display_gfs2(char *buf)
struct gfs2_leaf lf;
struct gfs_log_header lh1;
struct gfs2_log_header lh;
- struct gfs2_log_descriptor ld;
struct gfs2_quota_change qc;
uint32_t magic;
@@ -523,8 +522,7 @@ int display_gfs2(char *buf)
break;
case GFS2_METATYPE_LD:
- gfs2_log_descriptor_in(&ld, buf);
- gfs2_log_descriptor_print(&ld);
+ lgfs2_log_descriptor_print(buf);
break;
case GFS2_METATYPE_EA:
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 8c49d150..744c63c8 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -735,11 +735,11 @@ extern void gfs2_dinode_print(const struct gfs2_dinode *di);
extern void gfs2_leaf_print(const struct gfs2_leaf *lf);
extern void gfs2_ea_header_print(const struct gfs2_ea_header *ea, char *name);
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);
+extern void lgfs2_log_descriptor_print(void *ldp);
__END_DECLS
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index c4ce16b1..ab393715 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -584,13 +584,15 @@ void gfs2_log_descriptor_out(struct gfs2_log_descriptor *ld, char
*buf)
CPOUT_08(ld, str, ld_reserved, 32);
}
-void gfs2_log_descriptor_print(const struct gfs2_log_descriptor *ld)
+void lgfs2_log_descriptor_print(void *ldp)
{
- gfs2_meta_header_print(&ld->ld_header);
- pv(ld, ld_type, "%"PRIu32, "0x%"PRIx32);
- pv(ld, ld_length, "%"PRIu32, "0x%"PRIx32);
- pv(ld, ld_data1, "%"PRIu32, "0x%"PRIx32);
- pv(ld, ld_data2, "%"PRIu32, "0x%"PRIx32);
+ struct gfs2_log_descriptor *ld = ldp;
+
+ lgfs2_meta_header_print(&ld->ld_header);
+ printbe32(ld, ld_type);
+ printbe32(ld, ld_length);
+ printbe32(ld, ld_data1);
+ printbe32(ld, ld_data2);
}
void gfs2_statfs_change_in(struct gfs2_statfs_change *sc, char *buf)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date