xfs: optimize writes to reflink files
authorChristoph Hellwig <hch@lst.de>
Thu, 20 Oct 2016 04:53:50 +0000 (15:53 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 20 Oct 2016 04:53:50 +0000 (15:53 +1100)
commit3ba020befef030aaabbd5eb82a09f6ddf02a9542
treeb9f3d3f21209f5a875b51e4427d9b46141c77d08
parent5f9268ca53aca992106d74edde3e7cf6c1be60a0
xfs: optimize writes to reflink files

Instead of reserving space as the first thing in write_begin move it past
reading the extent in the data fork.  That way we only have to read from
the data fork once and can reuse that information for trimming the extent
to the shared/unshared boundary.  Additionally this allows to easily
limit the actual write size to said boundary, and avoid a roundtrip on the
ilock.

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