summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_reflink.h
diff options
context:
space:
mode:
authorDarrick J. Wong2016-10-03 18:11:35 +0200
committerDarrick J. Wong2016-10-05 22:55:40 +0200
commit43caeb187deb92b3cc343fce9c2310512f6ac9cd (patch)
treebd45c48042fec0ce1748f800733a5919b1dc5c18 /fs/xfs/xfs_reflink.h
parentxfs: support removing extents from CoW fork (diff)
downloadkernel-qcow2-linux-43caeb187deb92b3cc343fce9c2310512f6ac9cd.tar.gz
kernel-qcow2-linux-43caeb187deb92b3cc343fce9c2310512f6ac9cd.tar.xz
kernel-qcow2-linux-43caeb187deb92b3cc343fce9c2310512f6ac9cd.zip
xfs: move mappings from cow fork to data fork after copy-write
After the write component of a copy-write operation finishes, clean up the bookkeeping left behind. On error, we simply free the new blocks and pass the error up. If we succeed, however, then we must remove the old data fork mapping and move the cow fork mapping to the data fork. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> [hch: Call the CoW failure function during xfs_cancel_ioend] Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_reflink.h')
-rw-r--r--fs/xfs/xfs_reflink.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/xfs/xfs_reflink.h b/fs/xfs/xfs_reflink.h
index 11408c0f3415..bffa4befa534 100644
--- a/fs/xfs/xfs_reflink.h
+++ b/fs/xfs/xfs_reflink.h
@@ -33,4 +33,12 @@ extern bool xfs_reflink_find_cow_mapping(struct xfs_inode *ip, xfs_off_t offset,
extern int xfs_reflink_trim_irec_to_next_cow(struct xfs_inode *ip,
xfs_fileoff_t offset_fsb, struct xfs_bmbt_irec *imap);
+extern int xfs_reflink_cancel_cow_blocks(struct xfs_inode *ip,
+ struct xfs_trans **tpp, xfs_fileoff_t offset_fsb,
+ xfs_fileoff_t end_fsb);
+extern int xfs_reflink_cancel_cow_range(struct xfs_inode *ip, xfs_off_t offset,
+ xfs_off_t count);
+extern int xfs_reflink_end_cow(struct xfs_inode *ip, xfs_off_t offset,
+ xfs_off_t count);
+
#endif /* __XFS_REFLINK_H */