aboutsummaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_bmap.c
diff options
context:
space:
mode:
authorGravatar Darrick J. Wong <djwong@kernel.org> 2023-10-16 09:34:39 -0700
committerGravatar Darrick J. Wong <djwong@kernel.org> 2023-10-17 16:24:22 -0700
commit68db60bf01c131c09bbe35adf43bd957a4c124bc (patch)
tree05898334658a0cc5e8d1a50dfc32d02f7e971668 /fs/xfs/libxfs/xfs_bmap.c
parentxfs: create a helper to convert rtextents to rtblocks (diff)
downloadlinux-68db60bf01c131c09bbe35adf43bd957a4c124bc.tar.gz
linux-68db60bf01c131c09bbe35adf43bd957a4c124bc.tar.bz2
linux-68db60bf01c131c09bbe35adf43bd957a4c124bc.zip
xfs: create a helper to compute leftovers of realtime extents
Create a helper to compute the misalignment between a file extent (xfs_extlen_t) and a realtime extent. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/libxfs/xfs_bmap.c')
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 4e7de4f2fd7a..19203699b992 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -2989,7 +2989,7 @@ xfs_bmap_extsize_align(
* If realtime, and the result isn't a multiple of the realtime
* extent size we need to remove blocks until it is.
*/
- if (rt && (temp = (align_alen % mp->m_sb.sb_rextsize))) {
+ if (rt && (temp = xfs_extlen_to_rtxmod(mp, align_alen))) {
/*
* We're not covering the original request, or
* we won't be able to once we fix the length.
@@ -3016,7 +3016,7 @@ xfs_bmap_extsize_align(
else {
align_alen -= orig_off - align_off;
align_off = orig_off;
- align_alen -= align_alen % mp->m_sb.sb_rextsize;
+ align_alen -= xfs_extlen_to_rtxmod(mp, align_alen);
}
/*
* Result doesn't cover the request, fail it.