|
@@ -1697,37 +1697,3 @@ out:
|
|
trace_xfs_reflink_unshare_error(ip, error, _RET_IP_);
|
|
trace_xfs_reflink_unshare_error(ip, error, _RET_IP_);
|
|
return error;
|
|
return error;
|
|
}
|
|
}
|
|
-
|
|
|
|
-/*
|
|
|
|
- * Does this inode have any real CoW reservations?
|
|
|
|
- */
|
|
|
|
-bool
|
|
|
|
-xfs_reflink_has_real_cow_blocks(
|
|
|
|
- struct xfs_inode *ip)
|
|
|
|
-{
|
|
|
|
- struct xfs_bmbt_irec irec;
|
|
|
|
- struct xfs_ifork *ifp;
|
|
|
|
- struct xfs_bmbt_rec_host *gotp;
|
|
|
|
- xfs_extnum_t idx;
|
|
|
|
-
|
|
|
|
- if (!xfs_is_reflink_inode(ip))
|
|
|
|
- return false;
|
|
|
|
-
|
|
|
|
- /* Go find the old extent in the CoW fork. */
|
|
|
|
- ifp = XFS_IFORK_PTR(ip, XFS_COW_FORK);
|
|
|
|
- gotp = xfs_iext_bno_to_ext(ifp, 0, &idx);
|
|
|
|
- while (gotp) {
|
|
|
|
- xfs_bmbt_get_all(gotp, &irec);
|
|
|
|
-
|
|
|
|
- if (!isnullstartblock(irec.br_startblock))
|
|
|
|
- return true;
|
|
|
|
-
|
|
|
|
- /* Roll on... */
|
|
|
|
- idx++;
|
|
|
|
- if (idx >= ifp->if_bytes / sizeof(xfs_bmbt_rec_t))
|
|
|
|
- break;
|
|
|
|
- gotp = xfs_iext_get_ext(ifp, idx);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return false;
|
|
|
|
-}
|
|
|