From: Darrick J. Wong Date: Mon, 24 Feb 2025 18:21:55 +0000 (-0800) Subject: xfs: enable extent size hints for CoW operations X-Git-Tag: v6.14.0~97 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3ae3aadc4fc328885eb9c14f63cc7f53da8eb146;p=thirdparty%2Fxfsprogs-dev.git xfs: enable extent size hints for CoW operations Source kernel commit: 8e84e8052bc283ebb37f929eb9fb97483ea7385e Wire up the copy-on-write extent size hint for realtime files, and connect it to the rt allocator so that we avoid fragmentation on rt filesystems. Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index ed969983..1f7326ac 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -6518,7 +6518,13 @@ xfs_get_cowextsz_hint( a = 0; if (ip->i_diflags2 & XFS_DIFLAG2_COWEXTSIZE) a = ip->i_cowextsize; - b = xfs_get_extsz_hint(ip); + if (XFS_IS_REALTIME_INODE(ip)) { + b = 0; + if (ip->i_diflags & XFS_DIFLAG_EXTSIZE) + b = ip->i_extsize; + } else { + b = xfs_get_extsz_hint(ip); + } a = max(a, b); if (a == 0)