This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit e007367654df5f484a55eeede213b819ae8c8a23
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.
Show replies by date