summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_reflink.h
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2016-10-03 18:11:33 +0200
committerDarrick J. Wong <darrick.wong@oracle.com>2016-10-05 03:06:40 +0200
commit2a06705cd5954030a2c501a09ac1a24b1c4019c2 (patch)
tree7214c54e25dc1d8b5993e13db6d916e83063ddde /fs/xfs/xfs_reflink.h
parentxfs: support bmapping delalloc extents in the CoW fork (diff)
downloadlinux-2a06705cd5954030a2c501a09ac1a24b1c4019c2.tar.xz
linux-2a06705cd5954030a2c501a09ac1a24b1c4019c2.zip
xfs: create delalloc extents in CoW fork
Wire up iomap_begin to detect shared extents and create delayed allocation extents in the CoW fork: 1) Check if we already have an extent in the COW fork for the area. If so nothing to do, we can move along. 2) Look up block number for the current extent, and if there is none it's not shared move along. 3) Unshare the current extent as far as we are going to write into it. For this we avoid an additional COW fork lookup and use the information we set aside in step 1) above. 4) Goto 1) unless we've covered the whole range. Last but not least, this updates the xfs_reflink_reserve_cow_range calling convention to pass a byte offset and length, as that is what both callers expect anyway. This patch has been refactored considerably as part of the iomap transition. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_reflink.h')
-rw-r--r--fs/xfs/xfs_reflink.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/xfs/xfs_reflink.h b/fs/xfs/xfs_reflink.h
index 820b151c8206..f824f874234f 100644
--- a/fs/xfs/xfs_reflink.h
+++ b/fs/xfs/xfs_reflink.h
@@ -20,4 +20,13 @@
#ifndef __XFS_REFLINK_H
#define __XFS_REFLINK_H 1
+extern int xfs_reflink_find_shared(struct xfs_mount *mp, xfs_agnumber_t agno,
+ xfs_agblock_t agbno, xfs_extlen_t aglen, xfs_agblock_t *fbno,
+ xfs_extlen_t *flen, bool find_maximal);
+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);
+
#endif /* __XFS_REFLINK_H */