|
@@ -1697,14 +1697,13 @@ xfs_inode_clear_eofblocks_tag(
|
|
|
*/
|
|
|
static bool
|
|
|
xfs_prep_free_cowblocks(
|
|
|
- struct xfs_inode *ip,
|
|
|
- struct xfs_ifork *ifp)
|
|
|
+ struct xfs_inode *ip)
|
|
|
{
|
|
|
/*
|
|
|
* Just clear the tag if we have an empty cow fork or none at all. It's
|
|
|
* possible the inode was fully unshared since it was originally tagged.
|
|
|
*/
|
|
|
- if (!xfs_is_reflink_inode(ip) || !ifp->if_bytes) {
|
|
|
+ if (!xfs_inode_has_cow_data(ip)) {
|
|
|
trace_xfs_inode_free_cowblocks_invalid(ip);
|
|
|
xfs_inode_clear_cowblocks_tag(ip);
|
|
|
return false;
|
|
@@ -1742,11 +1741,10 @@ xfs_inode_free_cowblocks(
|
|
|
void *args)
|
|
|
{
|
|
|
struct xfs_eofblocks *eofb = args;
|
|
|
- struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_COW_FORK);
|
|
|
int match;
|
|
|
int ret = 0;
|
|
|
|
|
|
- if (!xfs_prep_free_cowblocks(ip, ifp))
|
|
|
+ if (!xfs_prep_free_cowblocks(ip))
|
|
|
return 0;
|
|
|
|
|
|
if (eofb) {
|
|
@@ -1771,7 +1769,7 @@ xfs_inode_free_cowblocks(
|
|
|
* Check again, nobody else should be able to dirty blocks or change
|
|
|
* the reflink iflag now that we have the first two locks held.
|
|
|
*/
|
|
|
- if (xfs_prep_free_cowblocks(ip, ifp))
|
|
|
+ if (xfs_prep_free_cowblocks(ip))
|
|
|
ret = xfs_reflink_cancel_cow_range(ip, 0, NULLFILEOFF, false);
|
|
|
|
|
|
xfs_iunlock(ip, XFS_MMAPLOCK_EXCL);
|