aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-11-16 22:11:34 -0600
committerEric Sandeen <sandeen@redhat.com>2017-11-16 22:11:34 -0600
commit501dd27684ca0fe064939d8a284db29287785c41 (patch)
tree7fc435b9ae7fe1770c5b706664b1fd602d563492
parentee2bb3f58521f7e661f6234485dae75d69cd40c9 (diff)
downloadxfsprogs-dev-501dd27684ca0fe064939d8a284db29287785c41.tar.gz
xfs: treat idx as a cursor in xfs_bmap_add_extent_hole_real
Source kernel commit: 1d2e0089e16642928c76f032c1dbd0eb6da22935 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: Christoph Hellwig <hch@lst.de> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r--libxfs/xfs_bmap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c
index fb0e639963..40bcd6d16c 100644
--- a/libxfs/xfs_bmap.c
+++ b/libxfs/xfs_bmap.c
@@ -2733,11 +2733,11 @@ xfs_bmap_add_extent_hole_real(
* left and on the right.
* Merge all three into a single extent record.
*/
- --*idx;
left.br_blockcount += new->br_blockcount + right.br_blockcount;
- xfs_iext_update_extent(ip, state, *idx, &left);
- xfs_iext_remove(ip, *idx + 1, 1, state);
+ xfs_iext_remove(ip, *idx, 1, state);
+ --*idx;
+ xfs_iext_update_extent(ip, state, *idx, &left);
XFS_IFORK_NEXT_SET(ip, whichfork,
XFS_IFORK_NEXTENTS(ip, whichfork) - 1);
@@ -2769,10 +2769,10 @@ xfs_bmap_add_extent_hole_real(
* on the left.
* Merge the new allocation with the left neighbor.
*/
- --*idx;
old = left;
-
left.br_blockcount += new->br_blockcount;
+
+ --*idx;
xfs_iext_update_extent(ip, state, *idx, &left);
if (cur == NULL) {