|
@@ -500,39 +500,6 @@ xfs_reflink_find_cow_mapping(
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
- * Trim an extent to end at the next CoW reservation past offset_fsb.
|
|
|
- */
|
|
|
-void
|
|
|
-xfs_reflink_trim_irec_to_next_cow(
|
|
|
- struct xfs_inode *ip,
|
|
|
- xfs_fileoff_t offset_fsb,
|
|
|
- struct xfs_bmbt_irec *imap)
|
|
|
-{
|
|
|
- struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_COW_FORK);
|
|
|
- struct xfs_bmbt_irec got;
|
|
|
- struct xfs_iext_cursor icur;
|
|
|
-
|
|
|
- if (!xfs_is_reflink_inode(ip))
|
|
|
- return;
|
|
|
-
|
|
|
- /* Find the extent in the CoW fork. */
|
|
|
- if (!xfs_iext_lookup_extent(ip, ifp, offset_fsb, &icur, &got))
|
|
|
- return;
|
|
|
-
|
|
|
- /* This is the extent before; try sliding up one. */
|
|
|
- if (got.br_startoff < offset_fsb) {
|
|
|
- if (!xfs_iext_next_extent(ifp, &icur, &got))
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (got.br_startoff >= imap->br_startoff + imap->br_blockcount)
|
|
|
- return;
|
|
|
-
|
|
|
- imap->br_blockcount = got.br_startoff - imap->br_startoff;
|
|
|
- trace_xfs_reflink_trim_irec(ip, imap);
|
|
|
-}
|
|
|
-
|
|
|
/*
|
|
|
* Cancel CoW reservations for some block range of an inode.
|
|
|
*
|