xfs: remove xfs_map_cow
authorChristoph Hellwig <hch@lst.de>
Thu, 12 Jul 2018 05:25:59 +0000 (22:25 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 12 Jul 2018 05:25:59 +0000 (22:25 -0700)
commit5c665e5b5af6b8ad3e38ee73cb495ec695bcf589
tree6c19fff57b24ed5065d436bdec21e9c366f8072d
parentfca8c805425c0d9435097a6c780e95332e54613a
xfs: remove xfs_map_cow

We can handle the existing cow mapping case as a special case directly
in xfs_writepage_map, and share code for allocating delalloc blocks
with regular I/O in xfs_map_blocks.  This means we need to always
call xfs_map_blocks for reflink inodes, but we can still skip most of
the work if it turns out that there is no COW mapping overlapping the
current block.

As a subtle detail we need to start caching holes in the wpc to deal
with the case of COW reservations between EOF.  But we'll need that
infrastructure later anyway, so this is no big deal.

Based on a patch from Dave Chinner.

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