Commit 4cc1ee5e authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: simplify the rmap code in xfs_bmse_merge

In Christoph's patch to refactor xfs_bmse_merge, the updated rmap code
does more work than it needs to (because map-extent auto-merges
records).  Remove the unnecessary unmap and save ourselves a deferred
op.
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent f91fb956
......@@ -5942,13 +5942,12 @@ xfs_bmse_merge(
xfs_iext_update_extent(ifp, current_ext - 1, &new);
xfs_iext_remove(ip, current_ext, 1, 0);
/* update reverse mapping */
/* update reverse mapping. rmap functions merge the rmaps for us */
error = xfs_rmap_unmap_extent(mp, dfops, ip, whichfork, got);
if (error)
return error;
error = xfs_rmap_unmap_extent(mp, dfops, ip, whichfork, left);
if (error)
return error;
memcpy(&new, got, sizeof(new));
new.br_startoff = left->br_startoff + left->br_blockcount;
return xfs_rmap_map_extent(mp, dfops, ip, whichfork, &new);
}
......
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