summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs
diff options
context:
space:
mode:
authorChristoph Hellwig2017-10-19 20:08:51 +0200
committerDarrick J. Wong2017-10-27 00:38:28 +0200
commit11f75b3bbad57998d1af99391ec3a8e076ab4dd9 (patch)
treee3152fe8313bd6d2918a56908a45de45a058a37b /fs/xfs/libxfs
parentxfs: remove xfs_bmse_shift_one (diff)
downloadkernel-qcow2-linux-11f75b3bbad57998d1af99391ec3a8e076ab4dd9.tar.gz
kernel-qcow2-linux-11f75b3bbad57998d1af99391ec3a8e076ab4dd9.tar.xz
kernel-qcow2-linux-11f75b3bbad57998d1af99391ec3a8e076ab4dd9.zip
xfs: update got in xfs_bmap_shift_update_extent
This way the caller gets the proper updated extent returned in got. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs')
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index ad7a36047df7..680be0561bb4 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -5591,35 +5591,33 @@ xfs_bmap_shift_update_extent(
xfs_fileoff_t startoff)
{
struct xfs_mount *mp = ip->i_mount;
- struct xfs_bmbt_irec new;
+ struct xfs_bmbt_irec prev = *got;
int error, i;
*logflags |= XFS_ILOG_CORE;
- new = *got;
- new.br_startoff = startoff;
+ got->br_startoff = startoff;
if (cur) {
- error = xfs_bmbt_lookup_eq(cur, got, &i);
+ error = xfs_bmbt_lookup_eq(cur, &prev, &i);
if (error)
return error;
XFS_WANT_CORRUPTED_RETURN(mp, i == 1);
- error = xfs_bmbt_update(cur, &new);
+ error = xfs_bmbt_update(cur, got);
if (error)
return error;
} else {
*logflags |= XFS_ILOG_DEXT;
}
- xfs_iext_update_extent(ip, xfs_bmap_fork_to_state(whichfork), idx,
- &new);
+ xfs_iext_update_extent(ip, xfs_bmap_fork_to_state(whichfork), idx, got);
/* update reverse mapping */
- error = xfs_rmap_unmap_extent(mp, dfops, ip, whichfork, got);
+ error = xfs_rmap_unmap_extent(mp, dfops, ip, whichfork, &prev);
if (error)
return error;
- return xfs_rmap_map_extent(mp, dfops, ip, whichfork, &new);
+ return xfs_rmap_map_extent(mp, dfops, ip, whichfork, got);
}
int