aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_refcount.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/libxfs/xfs_refcount.c')
-rw-r--r--fs/xfs/libxfs/xfs_refcount.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c
index 14b9e3e056cc..a5edac834843 100644
--- a/fs/xfs/libxfs/xfs_refcount.c
+++ b/fs/xfs/libxfs/xfs_refcount.c
@@ -1558,8 +1558,9 @@ xfs_refcount_alloc_cow_extent(
1558 return error; 1558 return error;
1559 1559
1560 /* Add rmap entry */ 1560 /* Add rmap entry */
1561 return xfs_rmap_alloc_extent(tp, XFS_FSB_TO_AGNO(mp, fsb), 1561 xfs_rmap_alloc_extent(tp, XFS_FSB_TO_AGNO(mp, fsb),
1562 XFS_FSB_TO_AGBNO(mp, fsb), len, XFS_RMAP_OWN_COW); 1562 XFS_FSB_TO_AGBNO(mp, fsb), len, XFS_RMAP_OWN_COW);
1563 return 0;
1563} 1564}
1564 1565
1565/* Forget a CoW staging event in the refcount btree. */ 1566/* Forget a CoW staging event in the refcount btree. */
@@ -1570,17 +1571,13 @@ xfs_refcount_free_cow_extent(
1570 xfs_extlen_t len) 1571 xfs_extlen_t len)
1571{ 1572{
1572 struct xfs_mount *mp = tp->t_mountp; 1573 struct xfs_mount *mp = tp->t_mountp;
1573 int error;
1574 1574
1575 if (!xfs_sb_version_hasreflink(&mp->m_sb)) 1575 if (!xfs_sb_version_hasreflink(&mp->m_sb))
1576 return 0; 1576 return 0;
1577 1577
1578 /* Remove rmap entry */ 1578 /* Remove rmap entry */
1579 error = xfs_rmap_free_extent(tp, XFS_FSB_TO_AGNO(mp, fsb), 1579 xfs_rmap_free_extent(tp, XFS_FSB_TO_AGNO(mp, fsb),
1580 XFS_FSB_TO_AGBNO(mp, fsb), len, XFS_RMAP_OWN_COW); 1580 XFS_FSB_TO_AGBNO(mp, fsb), len, XFS_RMAP_OWN_COW);
1581 if (error)
1582 return error;
1583
1584 return __xfs_refcount_add(tp, XFS_REFCOUNT_FREE_COW, fsb, len); 1581 return __xfs_refcount_add(tp, XFS_REFCOUNT_FREE_COW, fsb, len);
1585} 1582}
1586 1583