summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_bmap.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-11-03 18:34:44 +0100
committerDarrick J. Wong <darrick.wong@oracle.com>2017-11-06 20:53:40 +0100
commitb121459c7a56d2fb5a8ca6727bf9f87982738b01 (patch)
tree533094a7a0f1f16f6b41dbfe915eb4849ff714ad /fs/xfs/libxfs/xfs_bmap.c
parentxfs: iterate backwards in xfs_reflink_cancel_cow_blocks (diff)
downloadlinux-b121459c7a56d2fb5a8ca6727bf9f87982738b01.tar.xz
linux-b121459c7a56d2fb5a8ca6727bf9f87982738b01.zip
xfs: simplify xfs_reflink_convert_cow
Instead of looking up extents to convert and calling xfs_bmapi_write on each of them just let xfs_bmapi_write handle the full range. To make this robust add a new XFS_BMAPI_CONVERT_ONLY that only converts ranges and never allocates blocks. [darrick: shorten the stringified CONVERT_ONLY trace flag] 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/xfs_bmap.c')
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index e48fc5c6fcdf..af3d18eccac3 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -4331,7 +4331,8 @@ xfs_bmapi_write(
* First, deal with the hole before the allocated space
* that we found, if any.
*/
- if (need_alloc || wasdelay) {
+ if ((need_alloc || wasdelay) &&
+ !(flags & XFS_BMAPI_CONVERT_ONLY)) {
bma.eof = eof;
bma.conv = !!(flags & XFS_BMAPI_CONVERT);
bma.wasdel = wasdelay;