diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2017-08-30 19:06:36 -0400 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2017-09-01 16:08:26 -0400 |
commit | 4cc1ee5e654114aa7fac6993488ad2cd0b3411bb (patch) | |
tree | 432eba2d842e0f29626032d76cfe2ccdad2349ea | |
parent | f91fb956f243086c7a95c508f01152c74c35f6ce (diff) |
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: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | fs/xfs/libxfs/xfs_bmap.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 9b877024c804..9558f5ee1bf9 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c | |||
@@ -5942,13 +5942,12 @@ done: | |||
5942 | xfs_iext_update_extent(ifp, current_ext - 1, &new); | 5942 | xfs_iext_update_extent(ifp, current_ext - 1, &new); |
5943 | xfs_iext_remove(ip, current_ext, 1, 0); | 5943 | xfs_iext_remove(ip, current_ext, 1, 0); |
5944 | 5944 | ||
5945 | /* update reverse mapping */ | 5945 | /* update reverse mapping. rmap functions merge the rmaps for us */ |
5946 | error = xfs_rmap_unmap_extent(mp, dfops, ip, whichfork, got); | 5946 | error = xfs_rmap_unmap_extent(mp, dfops, ip, whichfork, got); |
5947 | if (error) | 5947 | if (error) |
5948 | return error; | 5948 | return error; |
5949 | error = xfs_rmap_unmap_extent(mp, dfops, ip, whichfork, left); | 5949 | memcpy(&new, got, sizeof(new)); |
5950 | if (error) | 5950 | new.br_startoff = left->br_startoff + left->br_blockcount; |
5951 | return error; | ||
5952 | return xfs_rmap_map_extent(mp, dfops, ip, whichfork, &new); | 5951 | return xfs_rmap_map_extent(mp, dfops, ip, whichfork, &new); |
5953 | } | 5952 | } |
5954 | 5953 | ||