@@ -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);
@@ -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;
@@ -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;
@@ -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);
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(-)