[gfs2-utils] 02/40: libgfs2: Add a function for printing on-disk meta
headers
by pagure@pagure.io
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.
2 years, 10 months
[gfs2-utils] 01/40: libgfs2: Provide macros for printing on-disk
fields
by pagure@pagure.io
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 9ab2d40fe9b7e23f43c3796b0a659b45d0370b71
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Apr 21 17:20:26 2021 +0100
libgfs2: Provide macros for printing on-disk fields
The functions in ondisk.c take a backwards approach to endianness
conversion, in that they work with native-endian data stored in on-disk
structures. To begin reversing that usage, add some field printing
macros which expect raw big-endian data passed to them instead of
pre-converted fields.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/ondisk.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index 35a0b3db..ca399736 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -16,6 +16,15 @@
print_it(" ", fmt, fmt2, struct->member); \
} while (0);
+#define printbe16(struct, member) do { \
+ print_it(" "#member, "%"PRIu16, "0x%"PRIx16, be16_to_cpu(struct->member)); \
+ } while(0)
+#define printbe32(struct, member) do { \
+ print_it(" "#member, "%"PRIu32, "0x%"PRIx32, be32_to_cpu(struct->member)); \
+ } while(0)
+#define printbe64(struct, member) do { \
+ print_it(" "#member, "%"PRIu64, "0x%"PRIx64, be64_to_cpu(struct->member)); \
+ } while(0)
#define CPIN_08(s1, s2, member, count) {memcpy((s1->member), (s2->member), (count));}
#define CPOUT_08(s1, s2, member, count) {memcpy((s2->member), (s1->member), (count));}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
2 years, 10 months
[gfs2-utils] branch andyp-sparse created (now 6004baa2)
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a change to branch andyp-sparse
in repository gfs2-utils.
at 6004baa2 fsck.gfs2: Fix remaining endianness sparse warnings
This branch includes the following new commits:
new 9ab2d40f libgfs2: Provide macros for printing on-disk fields
new c10073cb libgfs2: Add a function for printing on-disk meta headers
new f42aeb72 libgfs2: Expect big-endian data when printing log descriptors
new 2b6ca657 libgfs2: Remove gfs2_log_descriptor_{in,out}
new 5fe42ca0 libgfs2: Remove gfs2_quota_change_{in,out}
new ac0aa85c libgfs2: Remove gfs2_statfs_change_{in,out}
new 018c2b6a libgfs2: Remove gfs2_ea_header_in
new 411aa2e8 libgfs2: Convert gfs2_leaf_print to accept big-endian data
new c841138f libgfs2: Remove gfs2_quota_{in,out}
new 231938c4 Convert rgrp printing functions to expect big-endian data
new 6de94a06 libgfs2: Convert gfs2_sb_print to expect big-endian data
new 7b7515f7 gfs2_edit: Convert superblock printing to expect big-endian
new 940a709a gfs2_edit: Store big-endian data in the global dinode
new 20490270 libgfs2: Don't use on-disk structs with cpu-endian data in __init_dinode
new afa1d8df libgfs2: Fix endianness mismatches for struct gfs2_log_header
new fde3c618 gfs2_edit: Clean up display_gfs2()
new 75046254 libgfs2: Add a cpu-endian log header struct
new d2655752 libgfs2: Remove gfs2_dinode_print()
new fd2951b3 libgfs2: Remove i_di from struct gfs2_inode
new 83d957c1 libgfs2: Remove big-endian structs from struct rgrp_tree
new 767016aa libgfs2: Remove sd_sb from struct gfs2_sbd
new 454a9e68 libgfs2: Remove some now-unused functions
new 717c5a11 gfs2_edit: Use native-endian types for dirent processing
new 113aed8a libgfs2: Endianness improvements for gfs2_inum and gfs2_dirent
new 19d95b5b Remove some users of gfs2_leaf_in()
new 2ee34808 libgfs2: Endianness improvements for gfs2_leaf
new 0c03f1c5 libgfs2: Remove gfs2_meta_header_{in,out}
new 540aa645 libgfs2: Fix endianness conversions for superblock padding fields
new e11a74d9 libgfs2: Print di_size with the correct size
new 8bd2adc6 libgfs2: Don't parse/write de_cookie
new 95de05e0 libgfs2: Broaden use of struct lgfs2_inum
new cac95a6a gfs2l: Sparse fixes
new b1c1dbb4 libgfs2: Fix endianness tagging for gfs2_bit_search
new 0f1c60ac libgfs2: Remove gfs_jindex_in
new 23738249 Fix sparse warnings about linkage
new 029a4519 fsck.gfs2: Remove unused invalidate_fxns
new 1da6e760 libgfs2: Fix the remaining sparse warnings
new 78bf04b6 gfs2_convert: Fix the remaining sparse warnings
new b8203e6d gfs2_edit: Fix remaining endianness sparse warnings
new 6004baa2 fsck.gfs2: Fix remaining endianness sparse warnings
The 40 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
2 years, 10 months