Linux XFS filesystem development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Carlos Maiolino <cem@kernel.org>
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 01/15] xfs: remove the xlog_op_header_t typedef
Date: Mon, 15 Sep 2025 06:26:51 -0700	[thread overview]
Message-ID: <20250915132709.160247-2-hch@lst.de> (raw)
In-Reply-To: <20250915132709.160247-1-hch@lst.de>

There are almost no users of the typedef left, kill it and switch the
remaining users to use the underlying struct.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/libxfs/xfs_log_format.h |  5 ++---
 fs/xfs/xfs_log.c               | 17 +++++++++--------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_log_format.h b/fs/xfs/libxfs/xfs_log_format.h
index 890646b5c87a..e6070ad72af4 100644
--- a/fs/xfs/libxfs/xfs_log_format.h
+++ b/fs/xfs/libxfs/xfs_log_format.h
@@ -104,14 +104,13 @@ struct xfs_unmount_log_format {
 #define XLOG_END_TRANS		0x10	/* End a continued transaction */
 #define XLOG_UNMOUNT_TRANS	0x20	/* Unmount a filesystem transaction */
 
-
-typedef struct xlog_op_header {
+struct xlog_op_header {
 	__be32	   oh_tid;	/* transaction id of operation	:  4 b */
 	__be32	   oh_len;	/* bytes in data region		:  4 b */
 	__u8	   oh_clientid;	/* who sent me this		:  1 b */
 	__u8	   oh_flags;	/*				:  1 b */
 	__u16	   oh_res2;	/* 32 bit align			:  2 b */
-} xlog_op_header_t;
+};
 
 /* valid values for h_fmt */
 #define XLOG_FMT_UNKNOWN  0
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 69703dc3ef94..354e8e0114a6 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -2656,10 +2656,11 @@ xlog_state_get_iclog_space(
 	 * until you know exactly how many bytes get copied.  Therefore, wait
 	 * until later to update ic_offset.
 	 *
-	 * xlog_write() algorithm assumes that at least 2 xlog_op_header_t's
+	 * xlog_write() algorithm assumes that at least 2 xlog_op_header's
 	 * can fit into remaining data section.
 	 */
-	if (iclog->ic_size - iclog->ic_offset < 2*sizeof(xlog_op_header_t)) {
+	if (iclog->ic_size - iclog->ic_offset <
+	    2 * sizeof(struct xlog_op_header)) {
 		int		error = 0;
 
 		xlog_state_switch_iclogs(log, iclog, iclog->ic_size);
@@ -3153,11 +3154,11 @@ xlog_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
@@ -3180,12 +3181,12 @@ xlog_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 += log->l_iclog_hsize * num_headers;
@@ -3322,7 +3323,7 @@ xlog_verify_iclog(
 	struct xlog_in_core	*iclog,
 	int			count)
 {
-	xlog_op_header_t	*ophead;
+	struct xlog_op_header	*ophead;
 	xlog_in_core_t		*icptr;
 	xlog_in_core_2_t	*xhdr;
 	void			*base_ptr, *ptr, *p;
@@ -3400,7 +3401,7 @@ xlog_verify_iclog(
 				op_len = be32_to_cpu(iclog->ic_header.h_cycle_data[idx]);
 			}
 		}
-		ptr += sizeof(xlog_op_header_t) + op_len;
+		ptr += sizeof(struct xlog_op_header) + op_len;
 	}
 }
 #endif
-- 
2.47.2


  reply	other threads:[~2025-09-15 13:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-15 13:26 remove most typedefs from xfs_log_format.h Christoph Hellwig
2025-09-15 13:26 ` Christoph Hellwig [this message]
2025-09-15 13:26 ` [PATCH 02/15] xfs: remove the xfs_trans_header_t typedef Christoph Hellwig
2025-09-15 13:26 ` [PATCH 03/15] xfs: remove the xfs_extent_t typedef Christoph Hellwig
2025-09-15 13:26 ` [PATCH 04/15] xfs: remove the xfs_extent32_t typedef Christoph Hellwig
2025-09-15 13:26 ` [PATCH 05/15] xfs: remove the xfs_extent64_t typedef Christoph Hellwig
2025-09-15 13:26 ` [PATCH 06/15] xfs: remove the xfs_efi_log_format_t typedef Christoph Hellwig
2025-09-15 13:26 ` [PATCH 07/15] xfs: remove the xfs_efi_log_format_32_t typedef Christoph Hellwig
2025-09-15 13:26 ` [PATCH 08/15] xfs: remove the xfs_efi_log_format_64_t typedef Christoph Hellwig
2025-09-15 13:26 ` [PATCH 09/15] xfs: remove the xfs_efd_log_format_t typedef Christoph Hellwig
2025-09-15 13:27 ` [PATCH 10/15] xfs: remove the unused xfs_efd_log_format_32_t typedef Christoph Hellwig
2025-09-15 13:27 ` [PATCH 11/15] xfs: remove the unused xfs_efd_log_format_64_t typedef Christoph Hellwig
2025-09-15 13:27 ` [PATCH 12/15] xfs: remove the unused xfs_buf_log_format_t typedef Christoph Hellwig
2025-09-15 13:27 ` [PATCH 13/15] xfs: remove the unused xfs_dq_logformat_t typedef Christoph Hellwig
2025-09-15 13:27 ` [PATCH 14/15] xfs: remove the unused xfs_qoff_logformat_t typedef Christoph Hellwig
2025-09-15 13:27 ` [PATCH 15/15] xfs: remove the unused xfs_log_iovec_t typedef Christoph Hellwig
2025-09-15 18:29 ` remove most typedefs from xfs_log_format.h Darrick J. Wong
2025-09-16 11:34 ` Carlos Maiolino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250915132709.160247-2-hch@lst.de \
    --to=hch@lst.de \
    --cc=cem@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox