]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove __xfs_free_extent_later
authorDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 23:07:34 +0000 (16:07 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 17 Apr 2024 21:06:24 +0000 (14:06 -0700)
Source kernel commit: 4c88fef3af4a51c2cdba6a28237e98da4873e8dc

xfs_free_extent_later is a trivial helper, so remove it to reduce the
amount of thinking required to understand the deferred freeing
interface.  This will make it easier to introduce automatic reaping of
speculative allocations in the next patch.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
libxfs/xfs_ag.c
libxfs/xfs_alloc.c
libxfs/xfs_alloc.h
libxfs/xfs_bmap.c
libxfs/xfs_bmap_btree.c
libxfs/xfs_ialloc.c
libxfs/xfs_ialloc_btree.c
libxfs/xfs_refcount.c
libxfs/xfs_refcount_btree.c

index ac34a1c233c275f6ebac465a3c9de257b6ec8180..bdb8a08bbea79ebe61c4b53db63a58fca31015b5 100644 (file)
@@ -982,7 +982,7 @@ xfs_ag_shrink_space(
                if (err2 != -ENOSPC)
                        goto resv_err;
 
-               err2 = __xfs_free_extent_later(*tpp, args.fsbno, delta, NULL,
+               err2 = xfs_free_extent_later(*tpp, args.fsbno, delta, NULL,
                                XFS_AG_RESV_NONE, true);
                if (err2)
                        goto resv_err;
index 7ac7c2f6cc4c92e34c6754ed0289b3ce7da9c686..0a2404466f69c577081ba62f9a6ff6550344fd9f 100644 (file)
@@ -2519,7 +2519,7 @@ xfs_defer_agfl_block(
  * The list is maintained sorted (by block number).
  */
 int
-__xfs_free_extent_later(
+xfs_free_extent_later(
        struct xfs_trans                *tp,
        xfs_fsblock_t                   bno,
        xfs_filblks_t                   len,
index 6bb8d295c321d2aeebfa7f8e50e51b5dfcf4352b..6b95d1d8a853768a1ca3001f378166ae1b7a3fd0 100644 (file)
@@ -231,7 +231,7 @@ xfs_buf_to_agfl_bno(
        return bp->b_addr;
 }
 
-int __xfs_free_extent_later(struct xfs_trans *tp, xfs_fsblock_t bno,
+int xfs_free_extent_later(struct xfs_trans *tp, xfs_fsblock_t bno,
                xfs_filblks_t len, const struct xfs_owner_info *oinfo,
                enum xfs_ag_resv_type type, bool skip_discard);
 
@@ -256,18 +256,6 @@ void xfs_extent_free_get_group(struct xfs_mount *mp,
 #define XFS_EFI_ATTR_FORK      (1U << 1) /* freeing attr fork block */
 #define XFS_EFI_BMBT_BLOCK     (1U << 2) /* freeing bmap btree block */
 
-static inline int
-xfs_free_extent_later(
-       struct xfs_trans                *tp,
-       xfs_fsblock_t                   bno,
-       xfs_filblks_t                   len,
-       const struct xfs_owner_info     *oinfo,
-       enum xfs_ag_resv_type           type)
-{
-       return __xfs_free_extent_later(tp, bno, len, oinfo, type, false);
-}
-
-
 extern struct kmem_cache       *xfs_extfree_item_cache;
 
 int __init xfs_extfree_intent_init_cache(void);
index 8fde0dc256f0179cc1213c4a6ce6318efb1c224d..8c553d22c535602f65b275f29ef4aea44a3e0c6e 100644 (file)
@@ -569,7 +569,7 @@ xfs_bmap_btree_to_extents(
 
        xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork);
        error = xfs_free_extent_later(cur->bc_tp, cbno, 1, &oinfo,
-                       XFS_AG_RESV_NONE);
+                       XFS_AG_RESV_NONE, false);
        if (error)
                return error;
 
@@ -5212,7 +5212,7 @@ xfs_bmap_del_extent_real(
                if (xfs_is_reflink_inode(ip) && whichfork == XFS_DATA_FORK) {
                        xfs_refcount_decrease_extent(tp, del);
                } else {
-                       error = __xfs_free_extent_later(tp, del->br_startblock,
+                       error = xfs_free_extent_later(tp, del->br_startblock,
                                        del->br_blockcount, NULL,
                                        XFS_AG_RESV_NONE,
                                        ((bflags & XFS_BMAPI_NODISCARD) ||
index 925cc153b20961e1d2ff107e992897e8495bf732..c4d5c8a64747779c6a1960b7d94897af9bbfcaba 100644 (file)
@@ -270,7 +270,7 @@ xfs_bmbt_free_block(
 
        xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, cur->bc_ino.whichfork);
        error = xfs_free_extent_later(cur->bc_tp, fsbno, 1, &oinfo,
-                       XFS_AG_RESV_NONE);
+                       XFS_AG_RESV_NONE, false);
        if (error)
                return error;
 
index a95675b1d3d0a4b00ed1c80bdaab64f6825106eb..14826280d46e20dccfec1b746941b50c58aaad9d 100644 (file)
@@ -1849,7 +1849,7 @@ xfs_difree_inode_chunk(
                return xfs_free_extent_later(tp,
                                XFS_AGB_TO_FSB(mp, agno, sagbno),
                                M_IGEO(mp)->ialloc_blks, &XFS_RMAP_OINFO_INODES,
-                               XFS_AG_RESV_NONE);
+                               XFS_AG_RESV_NONE, false);
        }
 
        /* holemask is only 16-bits (fits in an unsigned long) */
@@ -1895,7 +1895,8 @@ xfs_difree_inode_chunk(
                ASSERT(contigblk % mp->m_sb.sb_spino_align == 0);
                error = xfs_free_extent_later(tp,
                                XFS_AGB_TO_FSB(mp, agno, agbno), contigblk,
-                               &XFS_RMAP_OINFO_INODES, XFS_AG_RESV_NONE);
+                               &XFS_RMAP_OINFO_INODES, XFS_AG_RESV_NONE,
+                               false);
                if (error)
                        return error;
 
index 0c5d7ba1ce7236885441a45ef5868695093f83f6..593cb1fcc1d93a2a8f854b4190e2a6842b2d9ff4 100644 (file)
@@ -160,7 +160,7 @@ __xfs_inobt_free_block(
        xfs_inobt_mod_blockcount(cur, -1);
        fsbno = XFS_DADDR_TO_FSB(cur->bc_mp, xfs_buf_daddr(bp));
        return xfs_free_extent_later(cur->bc_tp, fsbno, 1,
-                       &XFS_RMAP_OINFO_INOBT, resv);
+                       &XFS_RMAP_OINFO_INOBT, resv, false);
 }
 
 STATIC int
index ae72f25077adc9d3da158bea890a23118ce01dea..2284b45fbb044b8bcc9a64611108c4283e543c53 100644 (file)
@@ -1152,7 +1152,7 @@ xfs_refcount_adjust_extents(
                                                tmp.rc_startblock);
                                error = xfs_free_extent_later(cur->bc_tp, fsbno,
                                                  tmp.rc_blockcount, NULL,
-                                                 XFS_AG_RESV_NONE);
+                                                 XFS_AG_RESV_NONE, false);
                                if (error)
                                        goto out_error;
                        }
@@ -1214,7 +1214,7 @@ xfs_refcount_adjust_extents(
                                        ext.rc_startblock);
                        error = xfs_free_extent_later(cur->bc_tp, fsbno,
                                        ext.rc_blockcount, NULL,
-                                       XFS_AG_RESV_NONE);
+                                       XFS_AG_RESV_NONE, false);
                        if (error)
                                goto out_error;
                }
@@ -1984,7 +1984,7 @@ xfs_refcount_recover_cow_leftovers(
                /* Free the block. */
                error = xfs_free_extent_later(tp, fsb,
                                rr->rr_rrec.rc_blockcount, NULL,
-                               XFS_AG_RESV_NONE);
+                               XFS_AG_RESV_NONE, false);
                if (error)
                        goto out_trans;
 
index 67cb59e33500479f3c527df1fea070f9ef5e586b..bc8bd867eee730691c83661a84559cb1396d8176 100644 (file)
@@ -111,7 +111,7 @@ xfs_refcountbt_free_block(
        be32_add_cpu(&agf->agf_refcount_blocks, -1);
        xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_REFCOUNT_BLOCKS);
        return xfs_free_extent_later(cur->bc_tp, fsbno, 1,
-                       &XFS_RMAP_OINFO_REFC, XFS_AG_RESV_METADATA);
+                       &XFS_RMAP_OINFO_REFC, XFS_AG_RESV_METADATA, false);
 }
 
 STATIC int