]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: remove static reap limits from repair.h
authorDarrick J. Wong <djwong@kernel.org>
Tue, 8 Apr 2025 23:14:36 +0000 (16:14 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Fri, 5 Sep 2025 15:48:23 +0000 (08:48 -0700)
Delete XREAP_MAX_BINVAL and XREAP_MAX_DEFER_CHAIN because the reap code
now calculates those limits dynamically, so they're no longer needed.

Move the third limit (XREP_MAX_ITRUNCATE_EFIS) to the one file that uses
it.  Note that the btree rebuilding code should reserve exactly the
number of blocks needed to rebuild a btree, so it is rare that the newbt
code will need to add any EFIs to the commit transaction.  That's why
that static limit remains.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/newbt.c
fs/xfs/scrub/reap.c
fs/xfs/scrub/repair.h

index 1588ce971cb8e12543fe392525cd3f139e25e721..951ae8b71566c2cc3a6598489fcc1aaa04c3e98d 100644 (file)
 #include "scrub/repair.h"
 #include "scrub/newbt.h"
 
+/*
+ * 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.  The newbt code should reserve
+ * exactly the correct number of blocks to rebuild the btree, so there should
+ * not be any excess blocks to free when committing a new btree.
+ */
+#define XREP_MAX_ITRUNCATE_EFIS        (128)
+
 /*
  * Estimate proper slack values for a btree that's being reloaded.
  *
index d58fd57aaebb43af170e06a203ff658395ae79ee..82910188111dd761784ffb31a85f0c161e2563fd 100644 (file)
@@ -171,8 +171,6 @@ static inline bool xreap_is_dirty(const struct xreap_state *rs)
        return rs->nr_binval > 0 || rs->nr_deferred > 0;
 }
 
-#define XREAP_MAX_BINVAL       (2048)
-
 /*
  * Decide if we need to roll the transaction to clear out the the log
  * reservation that we allocated to buffer invalidations.
@@ -198,8 +196,6 @@ static inline bool xreap_inc_binval(struct xreap_state *rs)
        return rs->nr_binval < rs->max_binval;
 }
 
-#define XREAP_MAX_DEFER_CHAIN          (2048)
-
 /*
  * Decide if we want to finish the deferred ops that are attached to the scrub
  * transaction.  We don't want to queue huge chains of deferred ops because
index 9c04295742c85f03c2d218019a558a491752710b..2bb125c4f9bf2baca42f41852887a238ebb3f8de 100644 (file)
@@ -18,14 +18,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);