xfs: optimize xfs_reflink_end_cow
authorChristoph Hellwig <hch@lst.de>
Thu, 20 Oct 2016 04:54:45 +0000 (15:54 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 20 Oct 2016 04:54:45 +0000 (15:54 +1100)
commitc1112b6e626637ec09319883b63e705a931c398b
tree22bcdfb9829739e8341ee1aa302df9b58881c53e
parent3e0ee78f7a5a8ed43b129e9e4c5c0ff10c71df74
xfs: optimize xfs_reflink_end_cow

Instead of doing a full extent list search for each extent that is
to be deleted using xfs_bmapi_read and then doing another one inside
of xfs_bunmapi_cow use the same scheme that xfs_bumapi uses:  look
up the last extent to be deleted and then use the extent index to
walk downward until we are outside the range to be deleted.

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
fs/xfs/xfs_trace.h