]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: enable extent size hints for CoW operations
authorDarrick J. Wong <djwong@kernel.org>
Thu, 15 Aug 2024 18:58:27 +0000 (11:58 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Fri, 16 Aug 2024 21:57:43 +0000 (14:57 -0700)
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 <djwong@kernel.org>
libxfs/xfs_bmap.c

index 9dcd1cb8b1a7d31a9596ad944b7637962080646d..abbf076f9cbb125bc28903272ddb1f0cda7b7533 100644 (file)
@@ -6568,7 +6568,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)