From: Darrick J. Wong Date: Mon, 25 Nov 2024 21:14:24 +0000 (-0800) Subject: xfs: don't merge ioends across RTGs X-Git-Tag: v6.13.0~105 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5b4cdd7bae76979e36ce4751641a407cb08a19bd;p=thirdparty%2Fxfsprogs-dev.git xfs: don't merge ioends across RTGs Source kernel commit: b91afef724710e3dc7d65a28105ffd7a4e861d69 Unlike AGs, RTGs don't always have metadata in their first blocks, and thus we don't get automatic protection from merging I/O completions across RTG boundaries. Add code to set the IOMAP_F_BOUNDARY flag for ioends that start at the first block of a RTG so that they never get merged into the previous ioend. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- diff --git a/libxfs/xfs_rtgroup.h b/libxfs/xfs_rtgroup.h index 026f34f9..2ddfac9a 100644 --- a/libxfs/xfs_rtgroup.h +++ b/libxfs/xfs_rtgroup.h @@ -188,6 +188,15 @@ xfs_rtb_to_rgbno( return __xfs_rtb_to_rgbno(mp, rtbno); } +/* Is rtbno the start of a RT group? */ +static inline bool +xfs_rtbno_is_group_start( + struct xfs_mount *mp, + xfs_rtblock_t rtbno) +{ + return (rtbno & mp->m_rgblkmask) == 0; +} + static inline xfs_daddr_t xfs_rtb_to_daddr( struct xfs_mount *mp,