From: Andrey Albershteyn Date: Fri, 5 Dec 2025 15:01:45 +0000 (+0100) Subject: xfs: convert xlog_op_header_t typedef to struct X-Git-Tag: v6.18.0~40 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=69a385f4d85de047856e43a99a5a17e593f28496;p=xfsprogs-dev.git xfs: convert xlog_op_header_t typedef to struct Reviewed-by: Christoph Hellwig Signed-off-by: Andrey Albershteyn --- diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index 5c14dbb5..500a8d81 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -120,7 +120,7 @@ libxfs_device_zero(struct xfs_buftarg *btp, xfs_daddr_t start, uint len) 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 @@ static void unmount_record(void *p) 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 334e88cd..13b8297f 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -85,11 +85,11 @@ xfs_log_calc_unit_res( */ /* 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 @@ xfs_log_calc_unit_res( 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 7ef43956..f46cb319 100644 --- a/libxlog/xfs_log_recover.c +++ b/libxlog/xfs_log_recover.c @@ -674,7 +674,7 @@ xlog_find_tail( 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 @@ xlog_find_tail( 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 @@ xlog_recover_process_data( { 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 @@ xlog_recover_process_data( 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 f5bac21d..e442d6f7 100644 --- a/logprint/log_redo.c +++ b/logprint/log_redo.c @@ -793,7 +793,7 @@ xlog_print_trans_attri( 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 @@ xlog_print_trans_attri( 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 @@ xlog_print_trans_attri( 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 @@ xlog_print_trans_attri( 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 @@ xlog_print_trans_attri( 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 8a997fe1..aa90068c 100644 --- a/logprint/logprint.h +++ b/logprint/logprint.h @@ -65,7 +65,7 @@ int xlog_print_trans_attri_value(char **ptr, uint src_len, int value_len, 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);