All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Chandan Babu R <chandan.babu@oracle.com>,
	"Darrick J. Wong" <djwong@kernel.org>
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 6/8] xfs: lift XREP_MAX_ITRUNCATE_EFIS out of the scrub code
Date: Mon, 29 Apr 2024 06:49:15 +0200	[thread overview]
Message-ID: <20240429044917.1504566-7-hch@lst.de> (raw)
In-Reply-To: <20240429044917.1504566-1-hch@lst.de>

We want to play the same trick in the COW end I/O handler, so lift this
constant out of the scrub directory and change the prefix to XFS_.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/libxfs/xfs_trans_resv.h | 7 +++++++
 fs/xfs/scrub/newbt.c           | 2 +-
 fs/xfs/scrub/reap.c            | 2 +-
 fs/xfs/scrub/repair.h          | 8 --------
 4 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_trans_resv.h b/fs/xfs/libxfs/xfs_trans_resv.h
index 0554b9d775d269..51eb56560ee189 100644
--- a/fs/xfs/libxfs/xfs_trans_resv.h
+++ b/fs/xfs/libxfs/xfs_trans_resv.h
@@ -95,6 +95,13 @@ struct xfs_trans_resv {
 #define	XFS_ITRUNCATE_LOG_COUNT_REFLINK	8
 #define	XFS_WRITE_LOG_COUNT_REFLINK	8
 
+/*
+ * This is the maximum number of deferred extent freeing item extents (EFIs)
+ * that we'll attach to a transaction without rolling the transaction to avoid
+ * overrunning a tr_itruncate reservation.
+ */
+#define XFS_MAX_ITRUNCATE_EFIS		128
+
 void xfs_trans_resv_calc(struct xfs_mount *mp, struct xfs_trans_resv *resp);
 uint xfs_allocfree_block_count(struct xfs_mount *mp, uint num_ops);
 
diff --git a/fs/xfs/scrub/newbt.c b/fs/xfs/scrub/newbt.c
index 4a0271123d94ea..872f97db2a6425 100644
--- a/fs/xfs/scrub/newbt.c
+++ b/fs/xfs/scrub/newbt.c
@@ -452,7 +452,7 @@ xrep_newbt_free(
 		}
 
 		freed += ret;
-		if (freed >= XREP_MAX_ITRUNCATE_EFIS) {
+		if (freed >= XFS_MAX_ITRUNCATE_EFIS) {
 			error = xrep_defer_finish(sc);
 			if (error)
 				goto junkit;
diff --git a/fs/xfs/scrub/reap.c b/fs/xfs/scrub/reap.c
index 01ceaa4efa16bf..433891b0d08c73 100644
--- a/fs/xfs/scrub/reap.c
+++ b/fs/xfs/scrub/reap.c
@@ -169,7 +169,7 @@ static inline bool xreap_want_roll(const struct xreap_state *rs)
 {
 	if (rs->force_roll)
 		return true;
-	if (rs->deferred > XREP_MAX_ITRUNCATE_EFIS)
+	if (rs->deferred > XFS_MAX_ITRUNCATE_EFIS)
 		return true;
 	if (rs->invalidated > XREAP_MAX_BINVAL)
 		return true;
diff --git a/fs/xfs/scrub/repair.h b/fs/xfs/scrub/repair.h
index 0e0dc2bf985c21..ec76774afffb31 100644
--- a/fs/xfs/scrub/repair.h
+++ b/fs/xfs/scrub/repair.h
@@ -17,14 +17,6 @@ static inline int xrep_notsupported(struct xfs_scrub *sc)
 
 #ifdef CONFIG_XFS_ONLINE_REPAIR
 
-/*
- * This is the maximum number of deferred extent freeing item extents (EFIs)
- * that we'll attach to a transaction without rolling the transaction to avoid
- * overrunning a tr_itruncate reservation.
- */
-#define XREP_MAX_ITRUNCATE_EFIS	(128)
-
-
 /* Repair helpers */
 
 int xrep_attempt(struct xfs_scrub *sc, struct xchk_stats_run *run);
-- 
2.39.2


  parent reply	other threads:[~2024-04-29  4:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29  4:49 optimize COW end I/O remapping v2 Christoph Hellwig
2024-04-29  4:49 ` [PATCH 1/8] xfs: upgrade the extent counters in xfs_reflink_end_cow_extent later Christoph Hellwig
2024-04-29 15:26   ` Darrick J. Wong
2024-04-29 17:16     ` Christoph Hellwig
2024-04-29  4:49 ` [PATCH 2/8] xfs: remove a racy if_bytes check in xfs_reflink_end_cow_extent Christoph Hellwig
2024-04-29 15:27   ` Darrick J. Wong
2024-04-29 17:17     ` Christoph Hellwig
2024-04-29  4:49 ` [PATCH 3/8] xfs: consolidate the xfs_quota_reserve_blkres definitions Christoph Hellwig
2024-04-29  4:49 ` [PATCH 4/8] xfs: xfs_quota_unreserve_blkres can't fail Christoph Hellwig
2024-04-29 15:29   ` Darrick J. Wong
2024-04-29  4:49 ` [PATCH 5/8] xfs: simplify iext overflow checking and upgrade Christoph Hellwig
2024-04-29 15:32   ` Darrick J. Wong
2024-04-29  4:49 ` Christoph Hellwig [this message]
2024-04-29  4:49 ` [PATCH 7/8] xfs: optimize extent remapping in xfs_reflink_end_cow_extent Christoph Hellwig
2024-04-29 15:43   ` Darrick J. Wong
2024-04-30  9:38     ` Christoph Hellwig
2024-04-29  4:49 ` [PATCH 8/8] xfs: rename the del variable " Christoph Hellwig
2024-04-29 15:33   ` Darrick J. Wong
2024-04-29 17:18     ` 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=20240429044917.1504566-7-hch@lst.de \
    --to=hch@lst.de \
    --cc=chandan.babu@oracle.com \
    --cc=djwong@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.