From e784bcd5fb7e75c6271bc72a32712254f2dbfb00 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Thu, 16 Nov 2017 22:11:34 -0600 Subject: [PATCH] xfs: remove inode log format typedef Source kernel commit: 06b1132120d446bbaf844cbbae51f0afd3baacb8 Remove xfs_inode_log_format_t now that xfs_inode_log_format is explicitly padded and therefore is a real on-disk structure. This enables xfs/122 to check the size of the structure. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner [sandeen: same treatment in libxlog & logprint/ ] Signed-off-by: Eric Sandeen --- libxfs/xfs_log_format.h | 4 ++-- libxlog/xfs_log_recover.c | 4 ++-- logprint/log_misc.c | 14 +++++++------- logprint/log_print_all.c | 4 ++-- logprint/logprint.h | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h index 93dcaa78b..c6d3b0a77 100644 --- a/libxfs/xfs_log_format.h +++ b/libxfs/xfs_log_format.h @@ -264,7 +264,7 @@ typedef struct xfs_trans_header { * (if any) is indicated in the ilf_dsize field. Changes to this structure * must be added on to the end. */ -typedef struct xfs_inode_log_format { +struct xfs_inode_log_format { uint16_t ilf_type; /* inode log item type */ uint16_t ilf_size; /* size of this item */ uint32_t ilf_fields; /* flags for fields logged */ @@ -279,7 +279,7 @@ typedef struct xfs_inode_log_format { int64_t ilf_blkno; /* blkno of inode buffer */ int32_t ilf_len; /* len of inode buffer */ int32_t ilf_boffset; /* off of inode in buffer */ -} xfs_inode_log_format_t; +}; /* * Old 32 bit systems will log in this format without the 64 bit diff --git a/libxlog/xfs_log_recover.c b/libxlog/xfs_log_recover.c index 6cd77d5e2..6bd000c07 100644 --- a/libxlog/xfs_log_recover.c +++ b/libxlog/xfs_log_recover.c @@ -1090,7 +1090,7 @@ xlog_recover_add_to_trans( char *dp, int len) { - xfs_inode_log_format_t *in_f; /* any will do */ + struct xfs_inode_log_format *in_f; /* any will do */ xlog_recover_item_t *item; char *ptr; @@ -1112,7 +1112,7 @@ xlog_recover_add_to_trans( ptr = kmem_alloc(len, KM_SLEEP); memcpy(ptr, dp, len); - in_f = (xfs_inode_log_format_t *)ptr; + in_f = (struct xfs_inode_log_format *)ptr; /* take the tail entry */ item = list_entry(trans->r_itemq.prev, xlog_recover_item_t, ri_list); diff --git a/logprint/log_misc.c b/logprint/log_misc.c index 15166d3b2..fd46cc3a0 100644 --- a/logprint/log_misc.c +++ b/logprint/log_misc.c @@ -530,9 +530,9 @@ xlog_print_trans_inode( * print inode type header region * * memmove to ensure 8-byte alignment for the long longs in - * xfs_inode_log_format_t structure + * struct xfs_inode_log_format structure * - * len can be smaller than xfs_inode_log_format_t + * len can be smaller than struct xfs_inode_log_format * if format data is split over operations */ memmove(&src_lbuf, *ptr, MIN(sizeof(src_lbuf), len)); @@ -550,7 +550,7 @@ xlog_print_trans_inode( (long long)f->ilf_blkno, f->ilf_len, f->ilf_boffset); } else { ASSERT(len >= 4); /* must have at least 4 bytes if != 0 */ - f = (xfs_inode_log_format_t *)&src_lbuf; + f = (struct xfs_inode_log_format *)&src_lbuf; printf(_("INODE: #regs: %d Not printing rest of data\n"), f->ilf_size); return f->ilf_size; @@ -1480,14 +1480,14 @@ end: * if necessary, convert an xfs_inode_log_format struct from the old 32bit version * (which can have different field alignments) to the native 64 bit version */ -xfs_inode_log_format_t * -xfs_inode_item_format_convert(char *src_buf, uint len, xfs_inode_log_format_t *in_f) +struct xfs_inode_log_format * +xfs_inode_item_format_convert(char *src_buf, uint len, struct xfs_inode_log_format *in_f) { struct xfs_inode_log_format_32 *in_f32; /* if we have native format then just return buf without copying data */ - if (len == sizeof(xfs_inode_log_format_t)) { - return (xfs_inode_log_format_t *)src_buf; + if (len == sizeof(struct xfs_inode_log_format)) { + return (struct xfs_inode_log_format *)src_buf; } in_f32 = (struct xfs_inode_log_format_32 *)src_buf; diff --git a/logprint/log_print_all.c b/logprint/log_print_all.c index c3112ceba..c80bf3478 100644 --- a/logprint/log_print_all.c +++ b/logprint/log_print_all.c @@ -282,8 +282,8 @@ STATIC void xlog_recover_print_inode( xlog_recover_item_t *item) { - xfs_inode_log_format_t f_buf; - xfs_inode_log_format_t *f; + struct xfs_inode_log_format f_buf; + struct xfs_inode_log_format *f; int attr_index; int hasdata; int hasattr; diff --git a/logprint/logprint.h b/logprint/logprint.h index fc10e16ca..20f1be4e5 100644 --- a/logprint/logprint.h +++ b/logprint/logprint.h @@ -41,8 +41,8 @@ extern void print_xlog_record_line(void); extern void print_xlog_op_line(void); extern void print_stars(void); -extern xfs_inode_log_format_t * - xfs_inode_item_format_convert(char *, uint, xfs_inode_log_format_t *); +extern struct xfs_inode_log_format * + xfs_inode_item_format_convert(char *, uint, struct xfs_inode_log_format *); extern int xlog_print_trans_efi(char **ptr, uint src_len, int continued); extern void xlog_recover_print_efi(xlog_recover_item_t *item); -- 2.47.2