Linux XFS filesystem development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Andrey Albershteyn <aalbersh@kernel.org>
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 8/8] libxfs: provide xfs_quota.h
Date: Thu, 10 Sep 2026 15:28:38 +0200	[thread overview]
Message-ID: <20260910132840.1541283-9-hch@lst.de> (raw)
In-Reply-To: <20260910132840.1541283-1-hch@lst.de>

Reduce spurious include differences to the kernel files.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 libxfs/Makefile          |  1 +
 libxfs/stubs/xfs_quota.h | 20 ++++++++++++++++++++
 libxfs/xfs_attr.c        |  2 +-
 libxfs/xfs_bmap.c        |  2 +-
 libxfs/xfs_bmap_btree.c  |  2 +-
 libxfs/xfs_btree.c       |  1 +
 libxfs/xfs_dquot_buf.c   |  2 +-
 libxfs/xfs_exchmaps.c    |  1 +
 libxfs/xfs_metadir.c     |  1 +
 libxfs/xfs_metafile.c    |  1 +
 libxfs/xfs_platform.h    | 15 ---------------
 libxfs/xfs_trans_resv.c  |  2 +-
 12 files changed, 30 insertions(+), 20 deletions(-)
 create mode 100644 libxfs/stubs/xfs_quota.h

diff --git a/libxfs/Makefile b/libxfs/Makefile
index bf681435969c..9795982b0e83 100644
--- a/libxfs/Makefile
+++ b/libxfs/Makefile
@@ -78,6 +78,7 @@ HFILES = \
 	stubs/xfs_extent_busy.h \
 	stubs/xfs_inode.h \
 	stubs/xfs_mount.h \
+	stubs/xfs_quota.h \
 	stubs/xfs_trace.h \
 	stubs/xfs_trans.h
 
diff --git a/libxfs/stubs/xfs_quota.h b/libxfs/stubs/xfs_quota.h
new file mode 100644
index 000000000000..7bc545bd5449
--- /dev/null
+++ b/libxfs/stubs/xfs_quota.h
@@ -0,0 +1,20 @@
+#ifndef __XFS_QUOTA_H__
+#define __XFS_QUOTA_H__
+
+#include "xfs_quota_defs.h"
+
+#define xfs_trans_mod_dquot_byino(t,i,f,d)		({ \
+	uint _f = (f); \
+	_f = _f; /* shut up gcc */ \
+})
+#define xfs_trans_reserve_quota_nblks(t,i,b,n,f)	(0)
+
+/* hack too silence gcc */
+static inline int retzero(void) { return 0; }
+#define xfs_trans_unreserve_quota_nblks(t,i,b,n,f)	retzero()
+#define xfs_quota_unreserve_blkres(i,b) 		retzero()
+
+#define xfs_quota_reserve_blkres(i,b)		(0)
+#define xfs_qm_dqattach(i)			(0)
+
+#endif  /* __XFS_QUOTA_H__ */
diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c
index bff809676701..57a0a175c286 100644
--- a/libxfs/xfs_attr.c
+++ b/libxfs/xfs_attr.c
@@ -21,7 +21,7 @@
 #include "xfs_attr.h"
 #include "xfs_attr_leaf.h"
 #include "xfs_attr_remote.h"
-#include "xfs_quota_defs.h"
+#include "xfs_quota.h"
 #include "xfs_trans_space.h"
 #include "xfs_trace.h"
 #include "defer_item.h"
diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c
index 1d3460da84ca..cec59446711b 100644
--- a/libxfs/xfs_bmap.c
+++ b/libxfs/xfs_bmap.c
@@ -22,10 +22,10 @@
 #include "xfs_bmap_btree.h"
 #include "xfs_errortag.h"
 #include "xfs_error.h"
+#include "xfs_quota.h"
 #include "xfs_trans_space.h"
 #include "xfs_trace.h"
 #include "xfs_attr_leaf.h"
-#include "xfs_quota_defs.h"
 #include "xfs_rmap.h"
 #include "xfs_ag.h"
 #include "xfs_ag_resv.h"
diff --git a/libxfs/xfs_bmap_btree.c b/libxfs/xfs_bmap_btree.c
index 5b82e732d3ad..758a4b1ccf5b 100644
--- a/libxfs/xfs_bmap_btree.c
+++ b/libxfs/xfs_bmap_btree.c
@@ -19,10 +19,10 @@
 #include "xfs_bmap_btree.h"
 #include "xfs_bmap.h"
 #include "xfs_error.h"
+#include "xfs_quota.h"
 #include "xfs_trace.h"
 #include "xfs_rmap.h"
 #include "xfs_ag.h"
-#include "xfs_quota_defs.h"
 
 static struct kmem_cache	*xfs_bmbt_cur_cache;
 
diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c
index 3f820e7999a6..425fbefc31ad 100644
--- a/libxfs/xfs_btree.c
+++ b/libxfs/xfs_btree.c
@@ -31,6 +31,7 @@
 #include "xfs_rtrmap_btree.h"
 #include "xfs_bmap.h"
 #include "xfs_rmap.h"
+#include "xfs_quota.h"
 #include "xfs_metafile.h"
 #include "xfs_rtrefcount_btree.h"
 
diff --git a/libxfs/xfs_dquot_buf.c b/libxfs/xfs_dquot_buf.c
index b0cb2a2b1cc4..0e59106303c4 100644
--- a/libxfs/xfs_dquot_buf.c
+++ b/libxfs/xfs_dquot_buf.c
@@ -11,8 +11,8 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_mount.h"
-#include "xfs_quota_defs.h"
 #include "xfs_inode.h"
+#include "xfs_quota.h"
 #include "xfs_trans.h"
 #include "xfs_error.h"
 #include "xfs_health.h"
diff --git a/libxfs/xfs_exchmaps.c b/libxfs/xfs_exchmaps.c
index 7b9bba1d971c..7d6f949aa1f3 100644
--- a/libxfs/xfs_exchmaps.c
+++ b/libxfs/xfs_exchmaps.c
@@ -14,6 +14,7 @@
 #include "xfs_inode.h"
 #include "xfs_trans.h"
 #include "xfs_bmap.h"
+#include "xfs_quota.h"
 #include "xfs_exchmaps.h"
 #include "xfs_trace.h"
 #include "xfs_bmap_btree.h"
diff --git a/libxfs/xfs_metadir.c b/libxfs/xfs_metadir.c
index aecffb11a310..74c4596ee4cf 100644
--- a/libxfs/xfs_metadir.c
+++ b/libxfs/xfs_metadir.c
@@ -18,6 +18,7 @@
 #include "xfs_metadir.h"
 #include "xfs_trace.h"
 #include "xfs_inode.h"
+#include "xfs_quota.h"
 #include "xfs_ialloc.h"
 #include "xfs_bmap_btree.h"
 #include "xfs_da_format.h"
diff --git a/libxfs/xfs_metafile.c b/libxfs/xfs_metafile.c
index 7973feb3b411..71f004e9dc64 100644
--- a/libxfs/xfs_metafile.c
+++ b/libxfs/xfs_metafile.c
@@ -17,6 +17,7 @@
 #include "xfs_metafile.h"
 #include "xfs_trace.h"
 #include "xfs_inode.h"
+#include "xfs_quota.h"
 #include "xfs_errortag.h"
 #include "xfs_error.h"
 #include "xfs_alloc.h"
diff --git a/libxfs/xfs_platform.h b/libxfs/xfs_platform.h
index 542e633f0ffe..d09fb0aae00f 100644
--- a/libxfs/xfs_platform.h
+++ b/libxfs/xfs_platform.h
@@ -394,21 +394,6 @@ xfs_buf_readahead(
 
 #define xfs_trans_inode_buf(tp, bp)		((void) 0)
 
-/* quota bits */
-#define xfs_trans_mod_dquot_byino(t,i,f,d)		({ \
-	uint _f = (f); \
-	_f = _f; /* shut up gcc */ \
-})
-#define xfs_trans_reserve_quota_nblks(t,i,b,n,f)	(0)
-
-/* hack too silence gcc */
-static inline int retzero(void) { return 0; }
-#define xfs_trans_unreserve_quota_nblks(t,i,b,n,f)	retzero()
-#define xfs_quota_unreserve_blkres(i,b) 		retzero()
-
-#define xfs_quota_reserve_blkres(i,b)		(0)
-#define xfs_qm_dqattach(i)			(0)
-
 #define uuid_copy(s,d)		platform_uuid_copy((s),(d))
 #define uuid_equal(s,d)		(platform_uuid_compare((s),(d)) == 0)
 
diff --git a/libxfs/xfs_trans_resv.c b/libxfs/xfs_trans_resv.c
index 9294b72e61b7..5b7660b1cd8a 100644
--- a/libxfs/xfs_trans_resv.c
+++ b/libxfs/xfs_trans_resv.c
@@ -15,9 +15,9 @@
 #include "xfs_da_btree.h"
 #include "xfs_inode.h"
 #include "xfs_bmap_btree.h"
+#include "xfs_quota.h"
 #include "xfs_trans.h"
 #include "xfs_trans_space.h"
-#include "xfs_quota_defs.h"
 #include "xfs_rtbitmap.h"
 #include "xfs_trace.h"
 #include "defer_item.h"
-- 
2.53.0


  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 ` [PATCH 7/8] libxfs: provide xfs_extent_busy.h Christoph Hellwig
2026-09-10 13:28 ` Christoph Hellwig [this message]
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-9-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox