aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_bmap.c
diff options
context:
space:
mode:
authorDarrick J. Wong <[email protected]>2024-11-21 00:21:03 +0000
committerDarrick J. Wong <[email protected]>2024-12-23 21:06:14 +0000
commit8e84e8052bc283ebb37f929eb9fb97483ea7385e (patch)
treec75bfcd149b61a40bd169cc370539910aadc59bd /fs/xfs/libxfs/xfs_bmap.c
parentxfs: apply rt extent alignment constraints to CoW extsize hint (diff)
downloadkernel-8e84e8052bc283ebb37f929eb9fb97483ea7385e.tar.gz
kernel-8e84e8052bc283ebb37f929eb9fb97483ea7385e.zip
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" <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
Diffstat (limited to 'fs/xfs/libxfs/xfs_bmap.c')
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index ae3d33d60761..40ad22fb808b 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -6524,7 +6524,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)