Linux XFS filesystem development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Andrey Albershteyn <aalbersh@kernel.org>
Cc: "Darrick J . Wong " <djwong@kernel.org>,
	Eric Sandeen <sandeen@redhat.com>,
	Carlos Maiolino <cem@kernel.org>,
	linux-xfs@vger.kernel.org
Subject: [PATCH 11/13] libxfs: cleanup xfs_trans.h
Date: Mon,  5 Oct 2026 14:56:21 +0200	[thread overview]
Message-ID: <20261005125637.1340355-12-hch@lst.de> (raw)
In-Reply-To: <20261005125637.1340355-1-hch@lst.de>

Add new xfs_trans_priv.h and xfs_log.h stubs for definitions that aren't
in xfs_trans.h in the kernel.  This prepares for pulling in the kernel
version of xfs_trans.h.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 libxfs/Makefile               |  4 +++-
 libxfs/stubs/xfs_log.h        |  7 +++++++
 libxfs/stubs/xfs_trans.h      |  7 -------
 libxfs/stubs/xfs_trans_priv.h | 16 ++++++++++++++++
 libxfs/xfs_alloc.c            |  1 +
 libxfs/xfs_attr_leaf.c        |  1 +
 libxfs/xfs_btree.c            |  1 +
 libxfs/xfs_da_btree.c         |  1 +
 libxfs/xfs_defer.c            |  2 ++
 libxfs/xfs_dir2_block.c       |  1 +
 libxfs/xfs_dir2_data.c        |  1 +
 libxfs/xfs_dir2_node.c        |  1 +
 libxfs/xfs_ialloc.c           |  1 +
 libxfs/xfs_rtbitmap.c         |  1 +
 libxfs/xfs_sb.c               |  1 +
 libxfs/xfs_symlink_remote.c   |  1 +
 libxfs/xfs_trans_inode.c      |  1 +
 libxfs/xfs_trans_resv.c       |  1 +
 repair/phase2.c               |  1 +
 19 files changed, 42 insertions(+), 8 deletions(-)
 create mode 100644 libxfs/stubs/xfs_log.h
 create mode 100644 libxfs/stubs/xfs_trans_priv.h

diff --git a/libxfs/Makefile b/libxfs/Makefile
index 722e99168f63..f64dd596b645 100644
--- a/libxfs/Makefile
+++ b/libxfs/Makefile
@@ -79,10 +79,12 @@ HFILES = \
 	stubs/xfs_error.h \
 	stubs/xfs_extent_busy.h \
 	stubs/xfs_inode.h \
+	stubs/xfs_log.h \
 	stubs/xfs_mount.h \
 	stubs/xfs_quota.h \
 	stubs/xfs_trace.h \
-	stubs/xfs_trans.h
+	stubs/xfs_trans.h \
+	stubs/xfs_trans_priv.h
 
 CFILES = buf_mem.c \
 	cache.c \
diff --git a/libxfs/stubs/xfs_log.h b/libxfs/stubs/xfs_log.h
new file mode 100644
index 000000000000..98251ee06688
--- /dev/null
+++ b/libxfs/stubs/xfs_log.h
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
+#ifndef __XFS_LOG_H__
+#define __XFS_LOG_H__
+
+#define xfs_log_item_in_current_chkpt(lip)	(false)
+
+#endif /* __XFS_LOG_H__ */
diff --git a/libxfs/stubs/xfs_trans.h b/libxfs/stubs/xfs_trans.h
index aa4de91b43a9..2619347df923 100644
--- a/libxfs/stubs/xfs_trans.h
+++ b/libxfs/stubs/xfs_trans.h
@@ -52,7 +52,6 @@ typedef struct xfs_trans {
 	struct list_head	t_dfops;	/* deferred operations */
 } xfs_trans_t;
 
-void	xfs_trans_init(struct xfs_mount *);
 int	xfs_trans_roll(struct xfs_trans **);
 
 int	libxfs_trans_alloc(struct xfs_mount *mp, struct xfs_trans_res *resp,
@@ -130,10 +129,4 @@ libxfs_trans_read_buf(
 	return libxfs_trans_read_buf_map(mp, tp, btp, &map, 1, flags, bpp, ops);
 }
 
-#define xfs_log_item_in_current_chkpt(lip)	(false)
-
-/* Contorted mess to make gcc shut up about unused vars. */
-#define xfs_ail_get_push_target(ail)    \
-		((log) == (log) ? NULLCOMMITLSN : NULLCOMMITLSN)
-
 #endif	/* __XFS_TRANS_H__ */
diff --git a/libxfs/stubs/xfs_trans_priv.h b/libxfs/stubs/xfs_trans_priv.h
new file mode 100644
index 000000000000..bab4e6c2b6c2
--- /dev/null
+++ b/libxfs/stubs/xfs_trans_priv.h
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2000-2005 Silicon Graphics, Inc.
+ * All Rights Reserved.
+ */
+
+#ifndef __XFS_TRANS_PRIV_H__
+#define __XFS_TRANS_PRIV_H__
+
+void	xfs_trans_init(struct xfs_mount *);
+
+/* Contorted mess to make gcc shut up about unused vars. */
+#define xfs_ail_get_push_target(ail)    \
+	((log) == (log) ? NULLCOMMITLSN : NULLCOMMITLSN)
+
+#endif /* __XFS_TRANS_PRIV_H__ */
diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c
index 13ec03c3b45a..8feaa0edace1 100644
--- a/libxfs/xfs_alloc.c
+++ b/libxfs/xfs_alloc.c
@@ -22,6 +22,7 @@
 #include "xfs_trace.h"
 #include "xfs_trans.h"
 #include "xfs_buf_item.h"
+#include "xfs_log.h"
 #include "xfs_ag.h"
 #include "xfs_ag_resv.h"
 #include "xfs_bmap.h"
diff --git a/libxfs/xfs_attr_leaf.c b/libxfs/xfs_attr_leaf.c
index 240864676aec..86c5c09a5db4 100644
--- a/libxfs/xfs_attr_leaf.c
+++ b/libxfs/xfs_attr_leaf.c
@@ -26,6 +26,7 @@
 #include "xfs_trace.h"
 #include "xfs_buf_item.h"
 #include "xfs_dir2.h"
+#include "xfs_log.h"
 #include "xfs_ag.h"
 #include "xfs_errortag.h"
 #include "xfs_health.h"
diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c
index 9fcb6c349523..60ef7f08b1d3 100644
--- a/libxfs/xfs_btree.c
+++ b/libxfs/xfs_btree.c
@@ -19,6 +19,7 @@
 #include "xfs_error.h"
 #include "xfs_trace.h"
 #include "xfs_alloc.h"
+#include "xfs_log.h"
 #include "xfs_btree_staging.h"
 #include "xfs_ag.h"
 #include "xfs_alloc_btree.h"
diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c
index a3a3a1aa4c57..9debb95d86fa 100644
--- a/libxfs/xfs_da_btree.c
+++ b/libxfs/xfs_da_btree.c
@@ -21,6 +21,7 @@
 #include "xfs_error.h"
 #include "xfs_trace.h"
 #include "xfs_buf_item.h"
+#include "xfs_log.h"
 #include "xfs_errortag.h"
 #include "xfs_health.h"
 
diff --git a/libxfs/xfs_defer.c b/libxfs/xfs_defer.c
index 28e8dcf14475..ab1f81d8bcd2 100644
--- a/libxfs/xfs_defer.c
+++ b/libxfs/xfs_defer.c
@@ -12,10 +12,12 @@
 #include "xfs_mount.h"
 #include "xfs_defer.h"
 #include "xfs_trans.h"
+#include "xfs_trans_priv.h"
 #include "xfs_buf_item.h"
 #include "xfs_inode.h"
 #include "xfs_inode_item.h"
 #include "xfs_trace.h"
+#include "xfs_log.h"
 #include "xfs_rmap.h"
 #include "xfs_refcount.h"
 #include "xfs_bmap.h"
diff --git a/libxfs/xfs_dir2_block.c b/libxfs/xfs_dir2_block.c
index 54cb8b645c9c..6d70e6b429e7 100644
--- a/libxfs/xfs_dir2_block.c
+++ b/libxfs/xfs_dir2_block.c
@@ -19,6 +19,7 @@
 #include "xfs_dir2_priv.h"
 #include "xfs_error.h"
 #include "xfs_trace.h"
+#include "xfs_log.h"
 #include "xfs_health.h"
 
 /*
diff --git a/libxfs/xfs_dir2_data.c b/libxfs/xfs_dir2_data.c
index 23625d647da4..aecbab61014c 100644
--- a/libxfs/xfs_dir2_data.c
+++ b/libxfs/xfs_dir2_data.c
@@ -17,6 +17,7 @@
 #include "xfs_error.h"
 #include "xfs_trans.h"
 #include "xfs_buf_item.h"
+#include "xfs_log.h"
 #include "xfs_health.h"
 
 static xfs_failaddr_t xfs_dir2_data_freefind_verify(
diff --git a/libxfs/xfs_dir2_node.c b/libxfs/xfs_dir2_node.c
index 7641cbdb8e10..19cb536e53ef 100644
--- a/libxfs/xfs_dir2_node.c
+++ b/libxfs/xfs_dir2_node.c
@@ -19,6 +19,7 @@
 #include "xfs_trace.h"
 #include "xfs_trans.h"
 #include "xfs_buf_item.h"
+#include "xfs_log.h"
 #include "xfs_health.h"
 
 /*
diff --git a/libxfs/xfs_ialloc.c b/libxfs/xfs_ialloc.c
index 07f6c0094281..91f4cdf2e4f3 100644
--- a/libxfs/xfs_ialloc.c
+++ b/libxfs/xfs_ialloc.c
@@ -22,6 +22,7 @@
 #include "xfs_trans.h"
 #include "xfs_buf_item.h"
 #include "xfs_trace.h"
+#include "xfs_log.h"
 #include "xfs_rmap.h"
 #include "xfs_ag.h"
 #include "xfs_health.h"
diff --git a/libxfs/xfs_rtbitmap.c b/libxfs/xfs_rtbitmap.c
index d4b90548718c..590e0641ff0d 100644
--- a/libxfs/xfs_rtbitmap.c
+++ b/libxfs/xfs_rtbitmap.c
@@ -21,6 +21,7 @@
 #include "xfs_health.h"
 #include "xfs_sb.h"
 #include "xfs_errortag.h"
+#include "xfs_log.h"
 #include "xfs_buf_item.h"
 #include "xfs_extent_busy.h"
 
diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c
index 696bafd2cc3e..aae63ccdb6b5 100644
--- a/libxfs/xfs_sb.c
+++ b/libxfs/xfs_sb.c
@@ -19,6 +19,7 @@
 #include "xfs_buf_item.h"
 #include "xfs_bmap_btree.h"
 #include "xfs_alloc_btree.h"
+#include "xfs_log.h"
 #include "xfs_rmap_btree.h"
 #include "xfs_refcount_btree.h"
 #include "xfs_da_format.h"
diff --git a/libxfs/xfs_symlink_remote.c b/libxfs/xfs_symlink_remote.c
index 008953d402f6..b0dc3888bf1b 100644
--- a/libxfs/xfs_symlink_remote.c
+++ b/libxfs/xfs_symlink_remote.c
@@ -15,6 +15,7 @@
 #include "xfs_error.h"
 #include "xfs_trans.h"
 #include "xfs_buf_item.h"
+#include "xfs_log.h"
 #include "xfs_symlink_remote.h"
 #include "xfs_bit.h"
 #include "xfs_bmap.h"
diff --git a/libxfs/xfs_trans_inode.c b/libxfs/xfs_trans_inode.c
index 697671007561..e3dca0652d26 100644
--- a/libxfs/xfs_trans_inode.c
+++ b/libxfs/xfs_trans_inode.c
@@ -12,6 +12,7 @@
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_trans.h"
+#include "xfs_trans_priv.h"
 #include "xfs_inode_item.h"
 
 /*
diff --git a/libxfs/xfs_trans_resv.c b/libxfs/xfs_trans_resv.c
index 5b7660b1cd8a..d15ca0427584 100644
--- a/libxfs/xfs_trans_resv.c
+++ b/libxfs/xfs_trans_resv.c
@@ -19,6 +19,7 @@
 #include "xfs_trans.h"
 #include "xfs_trans_space.h"
 #include "xfs_rtbitmap.h"
+#include "xfs_log.h"
 #include "xfs_trace.h"
 #include "defer_item.h"
 
diff --git a/repair/phase2.c b/repair/phase2.c
index fc96f9c4223c..ee166e62a002 100644
--- a/repair/phase2.c
+++ b/repair/phase2.c
@@ -16,6 +16,7 @@
 #include "scan.h"
 #include "rt.h"
 #include "quotacheck.h"
+#include "xfs_trans_priv.h"
 
 /* workaround craziness in the xlog routines */
 int xlog_recover_do_trans(struct xlog *log, struct xlog_recover *t, int p)
-- 
2.53.0


  parent reply	other threads:[~2026-10-05 12:57 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05 12:56 reduce libxfs to kernel differences v2 Christoph Hellwig
2026-10-05 12:56 ` [PATCH 01/13] libxfs: use libxfs.h in xfs_platform.h Christoph Hellwig
2026-10-05 21:44   ` Darrick J. Wong
2026-10-05 12:56 ` [PATCH 02/13] libxfs: provide memalloc_nofs_{save,restore} stubs Christoph Hellwig
2026-10-05 21:45   ` Darrick J. Wong
2026-10-05 12:56 ` [PATCH 03/13] libxfs: remove a spurious xfs_rtbitmap.h include in xfs_sb.c Christoph Hellwig
2026-10-05 21:45   ` Darrick J. Wong
2026-10-05 12:56 ` [PATCH 04/13] libxfs: move the xfs_rtbitmap.h include in xfs_bmap.c Christoph Hellwig
2026-10-06 11:27   ` Andrey Albershteyn
2026-10-05 12:56 ` [PATCH 05/13] libxfs: remove the unused xfs_log_item.li_mountp field Christoph Hellwig
2026-10-05 21:46   ` Darrick J. Wong
2026-10-05 12:56 ` [PATCH 06/13] libxfs: remove the unused xfs_inode_log_item.ili_fsync_fields field Christoph Hellwig
2026-10-05 21:46   ` Darrick J. Wong
2026-10-05 12:56 ` [PATCH 07/13] libxfs: remove the xfs_log_item_t and xfs_buf_log_item_t typedefs Christoph Hellwig
2026-10-05 21:46   ` Darrick J. Wong
2026-10-05 12:56 ` [PATCH 08/13] libxfs: remove libxfs_trans_alloc_rollable Christoph Hellwig
2026-10-05 21:47   ` Darrick J. Wong
2026-10-05 12:56 ` [PATCH 09/13] libxfs: return int from xfs_buf_item_init Christoph Hellwig
2026-10-05 21:48   ` Darrick J. Wong
2026-10-05 12:56 ` [PATCH 10/13] libxfs: use xfs_buf_item.h and xfs_inode_item.h from the kernel source Christoph Hellwig
2026-10-05 21:48   ` Darrick J. Wong
2026-10-05 12:56 ` Christoph Hellwig [this message]
2026-10-05 21:48   ` [PATCH 11/13] libxfs: cleanup xfs_trans.h Darrick J. Wong
2026-10-05 12:56 ` [PATCH 12/13] libxfs: use xfs_trans.h from the kernel source Christoph Hellwig
2026-10-05 21:49   ` Darrick J. Wong
2026-10-07 13:41     ` Christoph Hellwig
2026-10-07 15:18       ` Darrick J. Wong
2026-10-08 10:59       ` Carlos Maiolino
2026-10-05 12:56 ` [PATCH 13/13] libxfs: use all log item headers from the kernel Christoph Hellwig
2026-10-05 21:50   ` Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2026-09-25 15:20 reduce libxfs to kernel differences Christoph Hellwig
2026-09-25 15:20 ` [PATCH 11/13] libxfs: cleanup xfs_trans.h Christoph Hellwig

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=20261005125637.1340355-12-hch@lst.de \
    --to=hch@lst.de \
    --cc=aalbersh@kernel.org \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /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