[PATCH 24/33] xfs: convert xlog_op_header_t typedef to struct

Andrey Albershteyn
2025-12-03T19:10:05Z

libxfs/rdwr.c | 4 ++--
libxfs/util.c | 8 ++++----
libxlog/xfs_log_recover.c | 12 ++++++------
logprint/log_redo.c | 10 +++++-----
logprint/logprint.h | 2 +-
5 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
index 5c14dbb5c8..500a8d8154 100644
--- a/libxfs/rdwr.c
+++ b/libxfs/rdwr.c
@@ -120,7 +120,7 @@

static void unmount_record(void *p)
{
- xlog_op_header_t *op = (xlog_op_header_t *)p;
+ struct xlog_op_header *op = (struct xlog_op_header *)p;
/* the data section must be 32 bit size aligned */
struct {
uint16_t magic;
@@ -137,7 +137,7 @@
op->oh_res2 = 0;

/* and the data for this op */
- memcpy((char *)p + sizeof(xlog_op_header_t), &magic, sizeof(magic));
+ memcpy((char *)p + sizeof(struct xlog_op_header), &magic, sizeof(magic));
}

static char *next(
diff --git a/libxfs/util.c b/libxfs/util.c
index 334e88cd3f..13b8297f73 100644
--- a/libxfs/util.c
+++ b/libxfs/util.c
@@ -85,11 +85,11 @@
*/

/* for trans header */
- unit_bytes += sizeof(xlog_op_header_t);
+ unit_bytes += sizeof(struct xlog_op_header);
unit_bytes += sizeof(xfs_trans_header_t);

/* for start-rec */
- unit_bytes += sizeof(xlog_op_header_t);
+ unit_bytes += sizeof(struct xlog_op_header);

/*
* for LR headers - the space for data in an iclog is the size minus
@@ -112,12 +112,12 @@
num_headers = howmany(unit_bytes, iclog_space);

/* for split-recs - ophdrs added when data split over LRs */
- unit_bytes += sizeof(xlog_op_header_t) * num_headers;
+ unit_bytes += sizeof(struct xlog_op_header) * num_headers;

/* add extra header reservations if we overrun */
while (!num_headers ||
howmany(unit_bytes, iclog_space) > num_headers) {
- unit_bytes += sizeof(xlog_op_header_t);
+ unit_bytes += sizeof(struct xlog_op_header);
num_headers++;
}
unit_bytes += iclog_header_size * num_headers;
diff --git a/libxlog/xfs_log_recover.c b/libxlog/xfs_log_recover.c
index 7ef43956e9..f46cb31977 100644
--- a/libxlog/xfs_log_recover.c
+++ b/libxlog/xfs_log_recover.c
@@ -674,7 +674,7 @@
xfs_daddr_t *tail_blk)
{
xlog_rec_header_t *rhead;
- xlog_op_header_t *op_head;
+ struct xlog_op_header *op_head;
char *offset = NULL;
struct xfs_buf *bp;
int error, i, found;
@@ -808,7 +808,7 @@
if (error)
goto done;

- op_head = (xlog_op_header_t *)offset;
+ op_head = (struct xlog_op_header *)offset;
if (op_head->oh_flags & XLOG_UNMOUNT_TRANS) {
/*
* Set tail and last sync so that newly written
@@ -1199,7 +1199,7 @@
{
char *lp;
int num_logops;
- xlog_op_header_t *ohead;
+ struct xlog_op_header *ohead;
struct xlog_recover *trans;
xlog_tid_t tid;
int error;
@@ -1214,9 +1214,9 @@
return (XFS_ERROR(EIO));

while ((dp < lp) && num_logops) {
- ASSERT(dp + sizeof(xlog_op_header_t) <= lp);
- ohead = (xlog_op_header_t *)dp;
- dp += sizeof(xlog_op_header_t);
+ ASSERT(dp + sizeof(struct xlog_op_header) <= lp);
+ ohead = (struct xlog_op_header *)dp;
+ dp += sizeof(struct xlog_op_header);
if (ohead->oh_clientid != XFS_TRANSACTION &&
ohead->oh_clientid != XFS_LOG) {
xfs_warn(log->l_mp, "%s: bad clientid 0x%x",
diff --git a/logprint/log_redo.c b/logprint/log_redo.c
index f5bac21d35..e442d6f7cd 100644
--- a/logprint/log_redo.c
+++ b/logprint/log_redo.c
@@ -793,7 +793,7 @@
int *i)
{
struct xfs_attri_log_format *src_f = NULL;
- xlog_op_header_t *head = NULL;
+ struct xlog_op_header *head = NULL;
void *name_ptr = NULL;
void *new_name_ptr = NULL;
void *value_ptr = NULL;
@@ -850,7 +850,7 @@
if (name_len > 0) {
printf(_("\n"));
(*i)++;
- head = (xlog_op_header_t *)*ptr;
+ head = (struct xlog_op_header *)*ptr;
xlog_print_op_header(head, *i, ptr);
name_ptr = *ptr;
error = xlog_print_trans_attri_name(ptr,
@@ -862,7 +862,7 @@
if (new_name_len > 0) {
printf(_("\n"));
(*i)++;
- head = (xlog_op_header_t *)*ptr;
+ head = (struct xlog_op_header *)*ptr;
xlog_print_op_header(head, *i, ptr);
new_name_ptr = *ptr;
error = xlog_print_trans_attri_name(ptr,
@@ -874,7 +874,7 @@
if (value_len > 0) {
printf(_("\n"));
(*i)++;
- head = (xlog_op_header_t *)*ptr;
+ head = (struct xlog_op_header *)*ptr;
xlog_print_op_header(head, *i, ptr);
value_ptr = *ptr;
error = xlog_print_trans_attri_value(ptr,
@@ -886,7 +886,7 @@
if (new_value_len > 0) {
printf(_("\n"));
(*i)++;
- head = (xlog_op_header_t *)*ptr;
+ head = (struct xlog_op_header *)*ptr;
xlog_print_op_header(head, *i, ptr);
new_value_ptr = *ptr;
error = xlog_print_trans_attri_value(ptr,
diff --git a/logprint/logprint.h b/logprint/logprint.h
index 8a997fe115..aa90068c8a 100644
--- a/logprint/logprint.h
+++ b/logprint/logprint.h
@@ -65,7 +65,7 @@
extern void xlog_recover_print_attri(struct xlog_recover_item *item);
extern int xlog_print_trans_attrd(char **ptr, uint len);
extern void xlog_recover_print_attrd(struct xlog_recover_item *item);
-extern void xlog_print_op_header(xlog_op_header_t *op_head, int i, char **ptr);
+extern void xlog_print_op_header(struct xlog_op_header *op_head, int i, char **ptr);

int xlog_print_trans_xmi(char **ptr, uint src_len, int continued);
void xlog_recover_print_xmi(struct xlog_recover_item *item);

--
- Andrey