xfs: optimize xfs_reflink_cancel_cow_blocks
authorChristoph Hellwig <hch@lst.de>
Thu, 20 Oct 2016 04:54:31 +0000 (15:54 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 20 Oct 2016 04:54:31 +0000 (15:54 +1100)
commit3e0ee78f7a5a8ed43b129e9e4c5c0ff10c71df74
treed4ce021a6f8d74d89d5567a6cb150aeb3180cb0a
parentfa5c836ca8eb5bad6316ddfc066acbc4e2485356
xfs: optimize xfs_reflink_cancel_cow_blocks

Rewrite xfs_reflink_cancel_cow_blocks so that we only do a search for
the first extent in the extent list and then iterate over the remaining
extents using the extent index, passing the extent we operate on
directly to xfs_bmap_del_extent_delay or xfs_bmap_del_extent_cow instead
of going through xfs_bunmapi and doing yet another extent list lookup.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_reflink.c