summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_reflink.c
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2016-11-10 10:29:43 +1100
committerDave Chinner <david@fromorbit.com>2016-11-10 10:29:43 +1100
commit0fc204e2eb648ca31c80c8490178f70135807f05 (patch)
treecf27fd44ec33fe0f38576c47843ebc3bf087d8bb /fs/xfs/xfs_reflink.c
parent8f23d318aa746ea0680637a535606637a19073db (diff)
parent98efe8af1c9ffac47e842b7a75ded903e2f028da (diff)
downloadop-kernel-dev-0fc204e2eb648ca31c80c8490178f70135807f05.zip
op-kernel-dev-0fc204e2eb648ca31c80c8490178f70135807f05.tar.gz
Merge branch 'xfs-4.10-misc-fixes-1' into for-next
Diffstat (limited to 'fs/xfs/xfs_reflink.c')
-rw-r--r--fs/xfs/xfs_reflink.c38
1 files changed, 2 insertions, 36 deletions
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
index a279b4e..0edf835 100644
--- a/fs/xfs/xfs_reflink.c
+++ b/fs/xfs/xfs_reflink.c
@@ -486,7 +486,7 @@ xfs_reflink_trim_irec_to_next_cow(
/* This is the extent before; try sliding up one. */
if (irec.br_startoff < offset_fsb) {
idx++;
- if (idx >= ifp->if_bytes / sizeof(xfs_bmbt_rec_t))
+ if (idx >= xfs_iext_count(ifp))
return 0;
gotp = xfs_iext_get_ext(ifp, idx);
xfs_bmbt_get_all(gotp, &irec);
@@ -566,7 +566,7 @@ xfs_reflink_cancel_cow_blocks(
xfs_bmap_del_extent_cow(ip, &idx, &got, &del);
}
- if (++idx >= ifp->if_bytes / sizeof(struct xfs_bmbt_rec))
+ if (++idx >= xfs_iext_count(ifp))
break;
xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &got);
}
@@ -1697,37 +1697,3 @@ out:
trace_xfs_reflink_unshare_error(ip, error, _RET_IP_);
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;
-}
OpenPOWER on IntegriCloud