From: Christoph Hellwig <hch@lst.de>
To: Andrey Albershteyn <aalbersh@kernel.org>
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 7/8] libxfs: provide xfs_extent_busy.h
Date: Thu, 10 Sep 2026 15:28:37 +0200 [thread overview]
Message-ID: <20260910132840.1541283-8-hch@lst.de> (raw)
In-Reply-To: <20260910132840.1541283-1-hch@lst.de>
Reduces various spurious differences with the kernel.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
libxfs/Makefile | 1 +
libxfs/stubs/xfs_extent_busy.h | 20 ++++++++++++++++++++
libxfs/xfs_alloc.c | 1 +
libxfs/xfs_alloc_btree.c | 1 +
libxfs/xfs_group.c | 1 +
libxfs/xfs_platform.h | 15 ---------------
libxfs/xfs_rmap_btree.c | 1 +
libxfs/xfs_rtbitmap.c | 1 +
libxfs/xfs_rtrefcount_btree.c | 1 +
libxfs/xfs_rtrmap_btree.c | 1 +
10 files changed, 28 insertions(+), 15 deletions(-)
create mode 100644 libxfs/stubs/xfs_extent_busy.h
diff --git a/libxfs/Makefile b/libxfs/Makefile
index d173a2c4b13b..bf681435969c 100644
--- a/libxfs/Makefile
+++ b/libxfs/Makefile
@@ -75,6 +75,7 @@ HFILES = \
xfs_zones.h \
stubs/xfs_buf_mem.h \
stubs/xfs_error.h \
+ stubs/xfs_extent_busy.h \
stubs/xfs_inode.h \
stubs/xfs_mount.h \
stubs/xfs_trace.h \
diff --git a/libxfs/stubs/xfs_extent_busy.h b/libxfs/stubs/xfs_extent_busy.h
new file mode 100644
index 000000000000..4fbebabca124
--- /dev/null
+++ b/libxfs/stubs/xfs_extent_busy.h
@@ -0,0 +1,20 @@
+#ifndef __XFS_EXTENT_BUSY_H__
+#define __XFS_EXTENT_BUSY_H__
+
+#define XFS_EXTENT_BUSY_DISCARDED 0x01 /* undergoing a discard op. */
+#define XFS_EXTENT_BUSY_SKIP_DISCARD 0x02 /* do not discard */
+
+#define xfs_extent_busy_reuse(...) ((void) 0)
+/* avoid unused variable warning */
+#define xfs_extent_busy_insert(tp,xg,bno,len,flags)({ \
+ struct xfs_group *__foo = xg; \
+ __foo = __foo; /* no set-but-unused warning */ \
+})
+#define xfs_extent_busy_trim(group,minlen,maxlen,bno,len,busy_gen) ({ \
+ unsigned __foo = *(busy_gen); \
+ *(busy_gen) = __foo; \
+ false; \
+})
+#define xfs_extent_busy_flush(tp,pag,busy_gen,alloc_flags) ((int)(0))
+
+#endif /* __XFS_EXTENT_BUSY_H__ */
diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c
index cf517d4a938a..4cad09d8be61 100644
--- a/libxfs/xfs_alloc.c
+++ b/libxfs/xfs_alloc.c
@@ -16,6 +16,7 @@
#include "xfs_rmap.h"
#include "xfs_alloc_btree.h"
#include "xfs_alloc.h"
+#include "xfs_extent_busy.h"
#include "xfs_errortag.h"
#include "xfs_error.h"
#include "xfs_trace.h"
diff --git a/libxfs/xfs_alloc_btree.c b/libxfs/xfs_alloc_btree.c
index 04e028194e8c..29f6ec1c3f6f 100644
--- a/libxfs/xfs_alloc_btree.c
+++ b/libxfs/xfs_alloc_btree.c
@@ -14,6 +14,7 @@
#include "xfs_btree_staging.h"
#include "xfs_alloc_btree.h"
#include "xfs_alloc.h"
+#include "xfs_extent_busy.h"
#include "xfs_error.h"
#include "xfs_health.h"
#include "xfs_trace.h"
diff --git a/libxfs/xfs_group.c b/libxfs/xfs_group.c
index 12ce312d1e50..2ff9d1e56b47 100644
--- a/libxfs/xfs_group.c
+++ b/libxfs/xfs_group.c
@@ -10,6 +10,7 @@
#include "xfs_mount.h"
#include "xfs_error.h"
#include "xfs_trace.h"
+#include "xfs_extent_busy.h"
#include "xfs_group.h"
/*
diff --git a/libxfs/xfs_platform.h b/libxfs/xfs_platform.h
index 7c62a40af458..542e633f0ffe 100644
--- a/libxfs/xfs_platform.h
+++ b/libxfs/xfs_platform.h
@@ -384,21 +384,6 @@ xfs_buf_readahead(
#define xfs_sort_inodes(i_tab, nr) ((void) 0)
/* space allocation */
-#define XFS_EXTENT_BUSY_DISCARDED 0x01 /* undergoing a discard op. */
-#define XFS_EXTENT_BUSY_SKIP_DISCARD 0x02 /* do not discard */
-
-#define xfs_extent_busy_reuse(...) ((void) 0)
-/* avoid unused variable warning */
-#define xfs_extent_busy_insert(tp,xg,bno,len,flags)({ \
- struct xfs_group *__foo = xg; \
- __foo = __foo; /* no set-but-unused warning */ \
-})
-#define xfs_extent_busy_trim(group,minlen,maxlen,bno,len,busy_gen) ({ \
- unsigned __foo = *(busy_gen); \
- *(busy_gen) = __foo; \
- false; \
-})
-#define xfs_extent_busy_flush(tp,pag,busy_gen,alloc_flags) ((int)(0))
#define xfs_rotorstep 1
#define xfs_bmap_rtalloc(a) (-ENOSYS)
diff --git a/libxfs/xfs_rmap_btree.c b/libxfs/xfs_rmap_btree.c
index 6e2a32d8382c..10b3272238eb 100644
--- a/libxfs/xfs_rmap_btree.c
+++ b/libxfs/xfs_rmap_btree.c
@@ -19,6 +19,7 @@
#include "xfs_health.h"
#include "xfs_trace.h"
#include "xfs_error.h"
+#include "xfs_extent_busy.h"
#include "xfs_ag.h"
#include "xfs_ag_resv.h"
#include "xfs_buf_mem.h"
diff --git a/libxfs/xfs_rtbitmap.c b/libxfs/xfs_rtbitmap.c
index d46a1617d076..6a0fc1032753 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_extent_busy.h"
/*
* Realtime allocator bitmap functions shared with userspace.
diff --git a/libxfs/xfs_rtrefcount_btree.c b/libxfs/xfs_rtrefcount_btree.c
index 6a6e85c413e0..22acc1411aac 100644
--- a/libxfs/xfs_rtrefcount_btree.c
+++ b/libxfs/xfs_rtrefcount_btree.c
@@ -23,6 +23,7 @@
#include "xfs_trace.h"
#include "xfs_cksum.h"
#include "xfs_error.h"
+#include "xfs_extent_busy.h"
#include "xfs_rtgroup.h"
#include "xfs_rtbitmap.h"
#include "xfs_metafile.h"
diff --git a/libxfs/xfs_rtrmap_btree.c b/libxfs/xfs_rtrmap_btree.c
index 81d517b94e46..c264bc5651c0 100644
--- a/libxfs/xfs_rtrmap_btree.c
+++ b/libxfs/xfs_rtrmap_btree.c
@@ -24,6 +24,7 @@
#include "xfs_trace.h"
#include "xfs_cksum.h"
#include "xfs_error.h"
+#include "xfs_extent_busy.h"
#include "xfs_rtgroup.h"
#include "xfs_bmap.h"
#include "xfs_health.h"
--
2.53.0
next prev parent reply other threads:[~2026-09-10 13:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 13:28 reduce libxfs divergence from the kernel Christoph Hellwig
2026-09-10 13:28 ` [PATCH 1/8] include: fix LIBHFILES in Makefile Christoph Hellwig
2026-09-10 13:28 ` [PATCH 2/8] libxfs: remove a spurious xfs.h include in xfs_zones.c Christoph Hellwig
2026-09-10 13:28 ` [PATCH 3/8] libxfs: move a few xfs_health.h includes Christoph Hellwig
2026-09-10 13:28 ` [PATCH 4/8] libxfs: find a better location for stub headers Christoph Hellwig
2026-09-10 13:28 ` [PATCH 5/8] libxfs: rename buf_mem.h to xfs_buf_mem.h Christoph Hellwig
2026-09-10 13:28 ` [PATCH 6/8] libxfs: provide xfs_error.h Christoph Hellwig
2026-09-10 13:28 ` Christoph Hellwig [this message]
2026-09-10 13:28 ` [PATCH 8/8] libxfs: provide xfs_quota.h Christoph Hellwig
2026-09-10 15:39 ` reduce libxfs divergence from the kernel Andrey Albershteyn
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=20260910132840.1541283-8-hch@lst.de \
--to=hch@lst.de \
--cc=aalbersh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.