mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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>
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user