Commit 657fcb23 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: treat idx as a cursor in xfs_bmap_del_extent_*

Stop poking before and after the index and just increment or decrement
it while doing our operations on it to prepare for a new extent list
implementation.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent a6818477
......@@ -4750,12 +4750,12 @@ xfs_bmap_del_extent_delay(
del->br_blockcount);
got->br_startblock = nullstartblock((int)got_indlen);
xfs_iext_update_extent(ip, state, *idx, got);
new.br_startoff = del_endoff;
new.br_state = got->br_state;
new.br_startblock = nullstartblock((int)new_indlen);
xfs_iext_update_extent(ip, state, *idx, got);
++*idx;
xfs_iext_insert(ip, *idx, 1, &new, state);
......@@ -4832,13 +4832,13 @@ xfs_bmap_del_extent_cow(
* Deleting the middle of the extent.
*/
got->br_blockcount = del->br_startoff - got->br_startoff;
xfs_iext_update_extent(ip, state, *idx, got);
new.br_startoff = del_endoff;
new.br_blockcount = got_endoff - del_endoff;
new.br_state = got->br_state;
new.br_startblock = del->br_startblock + del->br_blockcount;
xfs_iext_update_extent(ip, state, *idx, got);
++*idx;
xfs_iext_insert(ip, *idx, 1, &new, state);
break;
......@@ -5054,8 +5054,8 @@ xfs_bmap_del_extent_real(
flags |= xfs_ilog_fext(whichfork);
XFS_IFORK_NEXT_SET(ip, whichfork,
XFS_IFORK_NEXTENTS(ip, whichfork) + 1);
xfs_iext_insert(ip, *idx + 1, 1, &new, state);
++*idx;
xfs_iext_insert(ip, *idx, 1, &new, state);
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment