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 2b6ca657e58c7df31069fd32f9257bdbee83abcf
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Apr 21 17:57:07 2021 +0100
libgfs2: Remove gfs2_log_descriptor_{in,out}
Just one remaining user of these functions so update it to avoid storing
cpu-endian data in an on-disk struct and remove the functions.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/journal.c | 18 ++++++++++--------
gfs2/libgfs2/libgfs2.h | 2 --
gfs2/libgfs2/ondisk.c | 26 --------------------------
3 files changed, 10 insertions(+), 36 deletions(-)
diff --git a/gfs2/edit/journal.c b/gfs2/edit/journal.c
index 859919aa..e8b71dc5 100644
--- a/gfs2/edit/journal.c
+++ b/gfs2/edit/journal.c
@@ -367,9 +367,12 @@ static int process_ld(uint64_t abs_block, uint64_t wrappt, uint64_t
j_size,
struct rgrp_tree *rgd, int *prnt, uint64_t *bblk_off)
{
uint64_t *b;
- struct gfs2_log_descriptor ld;
+ struct gfs2_log_descriptor *ld = (void *)buf;
int ltndx, is_meta_ld = 0;
int ld_blocks = 0;
+ uint32_t ld_type = be32_to_cpu(ld->ld_type);
+ uint32_t ld_length = be32_to_cpu(ld->ld_length);
+ uint32_t ld_data1 = be32_to_cpu(ld->ld_data1);
uint32_t logtypes[2][6] = {
{GFS2_LOG_DESC_METADATA, GFS2_LOG_DESC_REVOKE,
GFS2_LOG_DESC_JDATA, 0, 0, 0},
@@ -381,7 +384,6 @@ static int process_ld(uint64_t abs_block, uint64_t wrappt, uint64_t
j_size,
{"Metadata", "Unlinked inode", "Dealloc inode",
"Quota", "Final Entry", "Unknown"}};
- gfs2_log_descriptor_in(&ld, buf);
if (sbd.gfs1)
b = (uint64_t *)(buf + sizeof(struct gfs_log_descriptor));
else
@@ -391,21 +393,21 @@ static int process_ld(uint64_t abs_block, uint64_t wrappt, uint64_t
j_size,
if (*prnt) {
print_gfs2("0x%"PRIx64" (j+%4"PRIx64"): Log descriptor,
",
abs_block, ((jb + wrappt) % j_size) / sbd.bsize);
- print_gfs2("type %d ", ld.ld_type);
+ print_gfs2("type %"PRIu32" ", ld_type);
for (ltndx = 0;; ltndx++) {
- if (ld.ld_type == logtypes[sbd.gfs1][ltndx] ||
+ if (ld_type == logtypes[sbd.gfs1][ltndx] ||
logtypes[sbd.gfs1][ltndx] == 0)
break;
}
print_gfs2("(%s) ", logtypestr[sbd.gfs1][ltndx]);
- print_gfs2("len:%u, data1: %u", ld.ld_length, ld.ld_data1);
+ print_gfs2("len:%"PRIu32", data1: %"PRIu32, ld_length, ld_data1);
eol(0);
print_gfs2(" ");
}
- ld_blocks = ld.ld_data1;
- if (ld.ld_type == GFS2_LOG_DESC_METADATA ||
- ld.ld_type == GFS_LOG_DESC_METADATA)
+ ld_blocks = ld_data1;
+ if (ld_type == GFS2_LOG_DESC_METADATA ||
+ ld_type == GFS_LOG_DESC_METADATA)
is_meta_ld = 1;
ld_blocks -= print_ld_blks(b, (buf + sbd.bsize), line, tblk, tblk_off,
bitblk, rgd, abs_block, *prnt, bblk_off,
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 744c63c8..7ef9fcc7 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -716,8 +716,6 @@ extern void gfs2_leaf_out(struct gfs2_leaf *lf, char *buf);
extern void gfs2_ea_header_in(struct gfs2_ea_header *ea, char *buf);
extern void gfs2_log_header_in(struct gfs2_log_header *lh, char *buf);
extern void gfs2_log_header_out(struct gfs2_log_header *lh, char *buf);
-extern void gfs2_log_descriptor_in(struct gfs2_log_descriptor *ld, char *buf);
-extern void gfs2_log_descriptor_out(struct gfs2_log_descriptor *ld, char *buf);
extern void gfs2_statfs_change_in(struct gfs2_statfs_change *sc, char *buf);
extern void gfs2_statfs_change_out(struct gfs2_statfs_change *sc, char *buf);
extern void gfs2_quota_change_in(struct gfs2_quota_change *qc, char *buf);
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index ab393715..c1602766 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -558,32 +558,6 @@ void gfs2_log_header_print(const struct gfs2_log_header *lh)
pv(lh, lh_local_dinodes, "%"PRId64, "0x%"PRIx64);
}
-void gfs2_log_descriptor_in(struct gfs2_log_descriptor *ld, char *buf)
-{
- struct gfs2_log_descriptor *str = (struct gfs2_log_descriptor *)buf;
-
- gfs2_meta_header_in(&ld->ld_header, buf);
- CPIN_32(ld, str, ld_type);
- CPIN_32(ld, str, ld_length);
- CPIN_32(ld, str, ld_data1);
- CPIN_32(ld, str, ld_data2);
-
- CPIN_08(ld, str, ld_reserved, 32);
-}
-
-void gfs2_log_descriptor_out(struct gfs2_log_descriptor *ld, char *buf)
-{
- struct gfs2_log_descriptor *str = (struct gfs2_log_descriptor *)buf;
-
- gfs2_meta_header_out(&ld->ld_header, buf);
- CPOUT_32(ld, str, ld_type);
- CPOUT_32(ld, str, ld_length);
- CPOUT_32(ld, str, ld_data1);
- CPOUT_32(ld, str, ld_data2);
-
- CPOUT_08(ld, str, ld_reserved, 32);
-}
-
void lgfs2_log_descriptor_print(void *ldp)
{
struct gfs2_log_descriptor *ld = ldp;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.