xfs: simplify xfs_reflink_convert_cow
authorChristoph Hellwig <hch@lst.de>
Fri, 3 Nov 2017 17:34:44 +0000 (10:34 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 6 Nov 2017 19:53:40 +0000 (11:53 -0800)
commitb121459c7a56d2fb5a8ca6727bf9f87982738b01
tree533094a7a0f1f16f6b41dbfe915eb4849ff714ad
parent41caabd0ab997bcfa9a4822fac32c0803f1cc3df
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>
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_bmap.h
fs/xfs/xfs_reflink.c