From c38ccf599022e7454a861145ce1a94c5b5d7e658 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 3 Nov 2017 10:34:47 -0700 Subject: xfs: remove the nr_extents argument to xfs_iext_remove We only have two places that remove 2 extents at the same time, so unroll the loop there. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_bmap.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'fs/xfs/libxfs/xfs_bmap.c') diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 2656b6cbbb6c..e9fcb6d496a4 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -1645,7 +1645,8 @@ xfs_bmap_add_extent_delay_real( */ LEFT.br_blockcount += PREV.br_blockcount + RIGHT.br_blockcount; - xfs_iext_remove(bma->ip, &bma->icur, 2, state); + xfs_iext_remove(bma->ip, &bma->icur, state); + xfs_iext_remove(bma->ip, &bma->icur, state); xfs_iext_prev(ifp, &bma->icur); xfs_iext_update_extent(bma->ip, state, &bma->icur, &LEFT); (*nextents)--; @@ -1680,7 +1681,7 @@ xfs_bmap_add_extent_delay_real( old = LEFT; LEFT.br_blockcount += PREV.br_blockcount; - xfs_iext_remove(bma->ip, &bma->icur, 1, state); + xfs_iext_remove(bma->ip, &bma->icur, state); xfs_iext_prev(ifp, &bma->icur); xfs_iext_update_extent(bma->ip, state, &bma->icur, &LEFT); @@ -1707,7 +1708,7 @@ xfs_bmap_add_extent_delay_real( PREV.br_blockcount += RIGHT.br_blockcount; xfs_iext_next(ifp, &bma->icur); - xfs_iext_remove(bma->ip, &bma->icur, 1, state); + xfs_iext_remove(bma->ip, &bma->icur, state); xfs_iext_prev(ifp, &bma->icur); xfs_iext_update_extent(bma->ip, state, &bma->icur, &PREV); @@ -2144,7 +2145,8 @@ xfs_bmap_add_extent_unwritten_real( */ LEFT.br_blockcount += PREV.br_blockcount + RIGHT.br_blockcount; - xfs_iext_remove(ip, icur, 2, state); + xfs_iext_remove(ip, icur, state); + xfs_iext_remove(ip, icur, state); xfs_iext_prev(ifp, icur); xfs_iext_update_extent(ip, state, icur, &LEFT); XFS_IFORK_NEXT_SET(ip, whichfork, @@ -2182,7 +2184,7 @@ xfs_bmap_add_extent_unwritten_real( */ LEFT.br_blockcount += PREV.br_blockcount; - xfs_iext_remove(ip, icur, 1, state); + xfs_iext_remove(ip, icur, state); xfs_iext_prev(ifp, icur); xfs_iext_update_extent(ip, state, icur, &LEFT); XFS_IFORK_NEXT_SET(ip, whichfork, @@ -2216,7 +2218,7 @@ xfs_bmap_add_extent_unwritten_real( PREV.br_state = new->br_state; xfs_iext_next(ifp, icur); - xfs_iext_remove(ip, icur, 1, state); + xfs_iext_remove(ip, icur, state); xfs_iext_prev(ifp, icur); xfs_iext_update_extent(ip, state, icur, &PREV); @@ -2583,7 +2585,7 @@ xfs_bmap_add_extent_hole_delay( left.br_startblock = nullstartblock(newlen); left.br_blockcount = temp; - xfs_iext_remove(ip, icur, 1, state); + xfs_iext_remove(ip, icur, state); xfs_iext_prev(ifp, icur); xfs_iext_update_extent(ip, state, icur, &left); break; @@ -2728,7 +2730,7 @@ xfs_bmap_add_extent_hole_real( */ left.br_blockcount += new->br_blockcount + right.br_blockcount; - xfs_iext_remove(ip, icur, 1, state); + xfs_iext_remove(ip, icur, state); xfs_iext_prev(ifp, icur); xfs_iext_update_extent(ip, state, icur, &left); @@ -4686,7 +4688,7 @@ xfs_bmap_del_extent_delay( /* * Matches the whole extent. Delete the entry. */ - xfs_iext_remove(ip, icur, 1, state); + xfs_iext_remove(ip, icur, state); xfs_iext_prev(ifp, icur); break; case BMAP_LEFT_FILLING: @@ -4787,7 +4789,7 @@ xfs_bmap_del_extent_cow( /* * Matches the whole extent. Delete the entry. */ - xfs_iext_remove(ip, icur, 1, state); + xfs_iext_remove(ip, icur, state); xfs_iext_prev(ifp, icur); break; case BMAP_LEFT_FILLING: @@ -4927,7 +4929,7 @@ xfs_bmap_del_extent_real( /* * Matches the whole extent. Delete the entry. */ - xfs_iext_remove(ip, icur, 1, state); + xfs_iext_remove(ip, icur, state); xfs_iext_prev(ifp, icur); XFS_IFORK_NEXT_SET(ip, whichfork, XFS_IFORK_NEXTENTS(ip, whichfork) - 1); @@ -5553,7 +5555,7 @@ xfs_bmse_merge( return error; done: - xfs_iext_remove(ip, icur, 1, 0); + xfs_iext_remove(ip, icur, 0); xfs_iext_prev(XFS_IFORK_PTR(ip, whichfork), icur); xfs_iext_update_extent(ip, xfs_bmap_fork_to_state(whichfork), icur, &new); -- cgit v1.2.3