summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_reflink.h
diff options
context:
space:
mode:
authorChristoph Hellwig2016-10-20 06:53:50 +0200
committerDave Chinner2016-10-20 06:53:50 +0200
commit3ba020befef030aaabbd5eb82a09f6ddf02a9542 (patch)
treeb9f3d3f21209f5a875b51e4427d9b46141c77d08 /fs/xfs/xfs_reflink.h
parentxfs: don't bother looking at the refcount tree for reads (diff)
downloadkernel-qcow2-linux-3ba020befef030aaabbd5eb82a09f6ddf02a9542.tar.gz
kernel-qcow2-linux-3ba020befef030aaabbd5eb82a09f6ddf02a9542.tar.xz
kernel-qcow2-linux-3ba020befef030aaabbd5eb82a09f6ddf02a9542.zip
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>
Diffstat (limited to 'fs/xfs/xfs_reflink.h')
-rw-r--r--fs/xfs/xfs_reflink.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/xfs_reflink.h b/fs/xfs/xfs_reflink.h
index 7ddd9f69560d..fad11607c9ad 100644
--- a/fs/xfs/xfs_reflink.h
+++ b/fs/xfs/xfs_reflink.h
@@ -26,8 +26,8 @@ extern int xfs_reflink_find_shared(struct xfs_mount *mp, xfs_agnumber_t agno,
extern int xfs_reflink_trim_around_shared(struct xfs_inode *ip,
struct xfs_bmbt_irec *irec, bool *shared, bool *trimmed);
-extern int xfs_reflink_reserve_cow_range(struct xfs_inode *ip,
- xfs_off_t offset, xfs_off_t count);
+extern int xfs_reflink_reserve_cow(struct xfs_inode *ip,
+ struct xfs_bmbt_irec *imap, bool *shared);
extern int xfs_reflink_allocate_cow_range(struct xfs_inode *ip,
xfs_off_t offset, xfs_off_t count);
extern bool xfs_reflink_find_cow_mapping(struct xfs_inode *ip, xfs_off_t offset,