From: Darrick J. Wong Date: Wed, 3 Jul 2024 21:22:31 +0000 (-0700) Subject: xfs: enable extent size hints for CoW operations X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=91e23d252cadfba3d850b10ce40d28831177a21e;p=users%2Fhch%2Fxfsprogs.git xfs: enable extent size hints for CoW operations 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 --- diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index d8a84c22a..5c01384cd 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -6531,7 +6531,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)