aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_rtalloc.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/xfs_rtalloc.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/xfs_rtalloc.c')
-rw-r--r--fs/xfs/xfs_rtalloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index 294aa0739be3..f5a3d5f8c948 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -2021,7 +2021,10 @@ xfs_rtallocate_align(
if (*noalign) {
align = mp->m_sb.sb_rextsize;
} else {
- align = xfs_get_extsz_hint(ap->ip);
+ if (ap->flags & XFS_BMAPI_COWFORK)
+ align = xfs_get_cowextsz_hint(ap->ip);
+ else
+ align = xfs_get_extsz_hint(ap->ip);
if (!align)
align = 1;
if (align == mp->m_sb.sb_rextsize)