xfs: calculate end_fsb later in xfs_zoned_fill_srcmap

xfs_trim_extent doesn't need the updated end_fsb as it already is
limited by the smap range.  Move the end_fsb calculation later to
prepare additional reasons that could reduce the smap range.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
Christoph Hellwig 2026-09-24 11:57:10 +02:00 committed by Carlos Maiolino
parent b74d34fa3c
commit b942c6919a

View File

@ -1613,8 +1613,8 @@ xfs_zoned_fill_srcmap(
/*
* There is a data fork mapping, only map until the end of it.
*/
*end_fsb = min(*end_fsb, smap.br_startoff + smap.br_blockcount);
xfs_trim_extent(&smap, offset_fsb, *end_fsb - offset_fsb);
*end_fsb = min(*end_fsb, smap.br_startoff + smap.br_blockcount);
return xfs_bmbt_to_iomap(ip, srcmap, &smap, flags, 0,
xfs_iomap_inode_sequence(ip, 0));
}