From patchwork Sun Dec 31 21:26:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13507644 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1078BA2E for ; Sun, 31 Dec 2023 21:26:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Xd8MumhO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84691C433C7; Sun, 31 Dec 2023 21:26:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704057994; bh=2Hb+GgPPiWa5gEnEZZkUbKnLFVutFHHFxMnbJ1jWvSA=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=Xd8MumhOnfgZBgoY+xDgE1PCrFGIDQ5cQLEBggydJ9U4KSBp7p+RSvTzB9XXoIxvY bUfQb90rV3/d/Q8K/OkxvtUB54nVjO6EvEJHgUYa76RNLZLCUc5nfttpPGxNqfhPsG 6BVbS9jb08/UwpECJxIwCoNjjAv5XxQ/khunfYJ0vkAzSMgBTje3d5zSElsjucRgbP gROtLc3sqc0aSYe0D7o5+Q8w9M1SkEiOlwit/jEGSwDOdk5sGJIzNzzlGK6CWdzMNV WzhpjrQ7+Oj5fBwrpzOWVnSswOaTpYzp273413x9FBTtI3iezTRXw8qxtMBdCWeVM2 7sahL4rpCK8Kg== Date: Sun, 31 Dec 2023 13:26:34 -0800 Subject: [PATCH 1/9] xfs: clean up extent free log intent item tracepoint callsites From: "Darrick J. Wong" To: djwong@kernel.org Cc: linux-xfs@vger.kernel.org Message-ID: <170404848351.1764329.7793913875638606493.stgit@frogsfrogsfrogs> In-Reply-To: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> References: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Pass the incore EFI structure to the tracepoints instead of open-coding the argument passing. This cleans up the call sites a bit. Signed-off-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_alloc.c | 7 +++---- fs/xfs/xfs_extfree_item.c | 6 ++---- fs/xfs/xfs_trace.h | 33 +++++++++++++++------------------ 3 files changed, 20 insertions(+), 26 deletions(-) diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c index ac31b62e70177..0d8cddb1b41ce 100644 --- a/fs/xfs/libxfs/xfs_alloc.c +++ b/fs/xfs/libxfs/xfs_alloc.c @@ -2573,7 +2573,7 @@ xfs_defer_agfl_block( xefi->xefi_owner = oinfo->oi_owner; xefi->xefi_agresv = XFS_AG_RESV_AGFL; - trace_xfs_agfl_free_defer(mp, agno, 0, agbno, 1); + trace_xfs_agfl_free_defer(mp, xefi); xfs_extent_free_get_group(mp, xefi); xfs_defer_add(tp, &xefi->xefi_list, &xfs_agfl_free_defer_type); @@ -2635,9 +2635,8 @@ xfs_defer_extent_free( } else { xefi->xefi_owner = XFS_RMAP_OWN_NULL; } - trace_xfs_bmap_free_defer(mp, - XFS_FSB_TO_AGNO(tp->t_mountp, bno), 0, - XFS_FSB_TO_AGBNO(tp->t_mountp, bno), len); + + trace_xfs_extent_free_defer(mp, xefi); xfs_extent_free_get_group(mp, xefi); *dfpp = xfs_defer_add(tp, &xefi->xefi_list, &xfs_extent_free_defer_type); diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c index 1d1185fca6a58..190d6a69e40b0 100644 --- a/fs/xfs/xfs_extfree_item.c +++ b/fs/xfs/xfs_extfree_item.c @@ -464,8 +464,7 @@ xfs_extent_free_finish_item( if (xefi->xefi_flags & XFS_EFI_BMBT_BLOCK) oinfo.oi_flags |= XFS_OWNER_INFO_BMBT_BLOCK; - trace_xfs_bmap_free_deferred(tp->t_mountp, xefi->xefi_pag->pag_agno, 0, - agbno, xefi->xefi_blockcount); + trace_xfs_extent_free_deferred(mp, xefi); /* * If we need a new transaction to make progress, the caller will log a @@ -542,8 +541,7 @@ xfs_agfl_free_finish_item( agbno = XFS_FSB_TO_AGBNO(mp, xefi->xefi_startblock); oinfo.oi_owner = xefi->xefi_owner; - trace_xfs_agfl_free_deferred(mp, xefi->xefi_pag->pag_agno, 0, agbno, - xefi->xefi_blockcount); + trace_xfs_agfl_free_deferred(mp, xefi); error = xfs_alloc_read_agf(xefi->xefi_pag, tp, 0, &agbp); if (!error) diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h index db5d2b20b36fc..aafc0735e20ac 100644 --- a/fs/xfs/xfs_trace.h +++ b/fs/xfs/xfs_trace.h @@ -88,6 +88,7 @@ struct xfs_parent_name_irec; struct xfs_attrlist_cursor_kern; struct xfs_imeta_update; struct xfs_rtgroup; +struct xfs_extent_free_item; #define XFS_ATTR_FILTER_FLAGS \ { XFS_ATTR_ROOT, "ROOT" }, \ @@ -2762,41 +2763,37 @@ DEFINE_DEFER_PENDING_EVENT(xfs_defer_item_pause); DEFINE_DEFER_PENDING_EVENT(xfs_defer_item_unpause); DECLARE_EVENT_CLASS(xfs_free_extent_deferred_class, - TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, - int type, xfs_agblock_t agbno, xfs_extlen_t len), - TP_ARGS(mp, agno, type, agbno, len), + TP_PROTO(struct xfs_mount *mp, struct xfs_extent_free_item *free), + TP_ARGS(mp, free), TP_STRUCT__entry( __field(dev_t, dev) __field(xfs_agnumber_t, agno) - __field(int, type) __field(xfs_agblock_t, agbno) __field(xfs_extlen_t, len) + __field(unsigned int, flags) ), TP_fast_assign( __entry->dev = mp->m_super->s_dev; - __entry->agno = agno; - __entry->type = type; - __entry->agbno = agbno; - __entry->len = len; + __entry->agno = XFS_FSB_TO_AGNO(mp, free->xefi_startblock); + __entry->agbno = XFS_FSB_TO_AGBNO(mp, free->xefi_startblock); + __entry->len = free->xefi_blockcount; + __entry->flags = free->xefi_flags; ), - TP_printk("dev %d:%d op %d agno 0x%x agbno 0x%x fsbcount 0x%x", + TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x flags 0x%x", MAJOR(__entry->dev), MINOR(__entry->dev), - __entry->type, __entry->agno, __entry->agbno, - __entry->len) + __entry->len, + __entry->flags) ); #define DEFINE_FREE_EXTENT_DEFERRED_EVENT(name) \ DEFINE_EVENT(xfs_free_extent_deferred_class, name, \ - TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ - int type, \ - xfs_agblock_t bno, \ - xfs_extlen_t len), \ - TP_ARGS(mp, agno, type, bno, len)) -DEFINE_FREE_EXTENT_DEFERRED_EVENT(xfs_bmap_free_defer); -DEFINE_FREE_EXTENT_DEFERRED_EVENT(xfs_bmap_free_deferred); + TP_PROTO(struct xfs_mount *mp, struct xfs_extent_free_item *free), \ + TP_ARGS(mp, free)) DEFINE_FREE_EXTENT_DEFERRED_EVENT(xfs_agfl_free_defer); DEFINE_FREE_EXTENT_DEFERRED_EVENT(xfs_agfl_free_deferred); +DEFINE_FREE_EXTENT_DEFERRED_EVENT(xfs_extent_free_defer); +DEFINE_FREE_EXTENT_DEFERRED_EVENT(xfs_extent_free_deferred); DECLARE_EVENT_CLASS(xfs_defer_pending_item_class, TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp, From patchwork Sun Dec 31 21:26:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13507645 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53998BA2B for ; Sun, 31 Dec 2023 21:26:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rMa7anwW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26B31C433C7; Sun, 31 Dec 2023 21:26:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704058010; bh=fuAF200cZdxxxPCPLPmxEbzmq/17DVxLf6R2JGZmEuk=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=rMa7anwWSlttBdFi10mQHrG3ceNszxFPAYrartozY3AMpQzaIjCZPX1sLNbQUnShG rA8hgkxG1rCdBl4qXg1OKITAkEgrnD+/Y3iqPug7VZ15+1AXw2H9+4kNuLl9LGpi7/ Aq75kdpJfkkmtfDFkhSNyCRO1w7wd0kntc7UCLVn3T4Xkqi1yz5bOPeLA3P+zTDrJc 6p3/fyE6fycFBzF05iT+EsRD36RVpQy3RRrFySQjBRYzCVAqqxr3CPYgX82CpXM0hH r0LlgrIBDrKLGgAxH9jqJx8paIfeCM2Kj2P9aFMt75RAw1j2FSIgfwO03DyDKCM9tT 1Nnc7RBb0oHXg== Date: Sun, 31 Dec 2023 13:26:49 -0800 Subject: [PATCH 2/9] xfs: convert "skip_discard" to a proper flags bitset From: "Darrick J. Wong" To: djwong@kernel.org Cc: linux-xfs@vger.kernel.org Message-ID: <170404848368.1764329.5255215453240604553.stgit@frogsfrogsfrogs> In-Reply-To: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> References: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Convert the boolean to skip discard on free into a proper flags field so that we can add more flags in the next patch. Signed-off-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_ag.c | 2 +- fs/xfs/libxfs/xfs_alloc.c | 13 +++++++------ fs/xfs/libxfs/xfs_alloc.h | 9 +++++++-- fs/xfs/libxfs/xfs_bmap.c | 12 ++++++++---- fs/xfs/libxfs/xfs_bmap_btree.c | 2 +- fs/xfs/libxfs/xfs_ialloc.c | 5 ++--- fs/xfs/libxfs/xfs_ialloc_btree.c | 2 +- fs/xfs/libxfs/xfs_refcount.c | 6 +++--- fs/xfs/libxfs/xfs_refcount_btree.c | 2 +- fs/xfs/scrub/newbt.c | 5 +++-- fs/xfs/scrub/reap.c | 7 ++++--- fs/xfs/xfs_reflink.c | 2 +- 12 files changed, 39 insertions(+), 28 deletions(-) diff --git a/fs/xfs/libxfs/xfs_ag.c b/fs/xfs/libxfs/xfs_ag.c index 136e02bb1c9eb..35deb474a7cf0 100644 --- a/fs/xfs/libxfs/xfs_ag.c +++ b/fs/xfs/libxfs/xfs_ag.c @@ -980,7 +980,7 @@ xfs_ag_shrink_space( goto resv_err; err2 = xfs_free_extent_later(*tpp, args.fsbno, delta, NULL, - XFS_AG_RESV_NONE, true); + XFS_AG_RESV_NONE, XFS_FREE_EXTENT_SKIP_DISCARD); if (err2) goto resv_err; diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c index 0d8cddb1b41ce..1ea88d4675f5f 100644 --- a/fs/xfs/libxfs/xfs_alloc.c +++ b/fs/xfs/libxfs/xfs_alloc.c @@ -2591,7 +2591,7 @@ xfs_defer_extent_free( xfs_filblks_t len, const struct xfs_owner_info *oinfo, enum xfs_ag_resv_type type, - bool skip_discard, + unsigned int free_flags, struct xfs_defer_pending **dfpp) { struct xfs_extent_free_item *xefi; @@ -2611,6 +2611,7 @@ xfs_defer_extent_free( ASSERT(len < mp->m_sb.sb_agblocks); ASSERT(agbno + len <= mp->m_sb.sb_agblocks); #endif + ASSERT(!(free_flags & ~XFS_FREE_EXTENT_ALL_FLAGS)); ASSERT(xfs_extfree_item_cache != NULL); ASSERT(type != XFS_AG_RESV_AGFL); @@ -2622,7 +2623,7 @@ xfs_defer_extent_free( xefi->xefi_startblock = bno; xefi->xefi_blockcount = (xfs_extlen_t)len; xefi->xefi_agresv = type; - if (skip_discard) + if (free_flags & XFS_FREE_EXTENT_SKIP_DISCARD) xefi->xefi_flags |= XFS_EFI_SKIP_DISCARD; if (oinfo) { ASSERT(oinfo->oi_offset == 0); @@ -2650,11 +2651,11 @@ xfs_free_extent_later( xfs_filblks_t len, const struct xfs_owner_info *oinfo, enum xfs_ag_resv_type type, - bool skip_discard) + unsigned int free_flags) { struct xfs_defer_pending *dontcare = NULL; - return xfs_defer_extent_free(tp, bno, len, oinfo, type, skip_discard, + return xfs_defer_extent_free(tp, bno, len, oinfo, type, free_flags, &dontcare); } @@ -2679,13 +2680,13 @@ xfs_free_extent_later( int xfs_alloc_schedule_autoreap( const struct xfs_alloc_arg *args, - bool skip_discard, + unsigned int free_flags, struct xfs_alloc_autoreap *aarp) { int error; error = xfs_defer_extent_free(args->tp, args->fsbno, args->len, - &args->oinfo, args->resv, skip_discard, &aarp->dfp); + &args->oinfo, args->resv, free_flags, &aarp->dfp); if (error) return error; diff --git a/fs/xfs/libxfs/xfs_alloc.h b/fs/xfs/libxfs/xfs_alloc.h index 0b956f8b9d5a7..2da543fb90ecd 100644 --- a/fs/xfs/libxfs/xfs_alloc.h +++ b/fs/xfs/libxfs/xfs_alloc.h @@ -233,7 +233,12 @@ xfs_buf_to_agfl_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); + enum xfs_ag_resv_type type, unsigned int free_flags); + +/* Don't issue a discard for the blocks freed. */ +#define XFS_FREE_EXTENT_SKIP_DISCARD (1U << 0) + +#define XFS_FREE_EXTENT_ALL_FLAGS (XFS_FREE_EXTENT_SKIP_DISCARD) /* * List of extents to be free "later". @@ -262,7 +267,7 @@ struct xfs_alloc_autoreap { }; int xfs_alloc_schedule_autoreap(const struct xfs_alloc_arg *args, - bool skip_discard, struct xfs_alloc_autoreap *aarp); + unsigned int free_flags, struct xfs_alloc_autoreap *aarp); void xfs_alloc_cancel_autoreap(struct xfs_trans *tp, struct xfs_alloc_autoreap *aarp); void xfs_alloc_commit_autoreap(struct xfs_trans *tp, diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 2bc0b76bcfbbb..ce9c247525a3d 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -588,7 +588,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, false); + XFS_AG_RESV_NONE, 0); if (error) return error; @@ -5266,11 +5266,15 @@ xfs_bmap_del_extent_real( if (xfs_is_reflink_inode(ip) && whichfork == XFS_DATA_FORK) { xfs_refcount_decrease_extent(tp, del); } else { + unsigned int efi_flags = 0; + + if ((bflags & XFS_BMAPI_NODISCARD) || + del->br_state == XFS_EXT_UNWRITTEN) + efi_flags |= XFS_FREE_EXTENT_SKIP_DISCARD; + error = xfs_free_extent_later(tp, del->br_startblock, del->br_blockcount, NULL, - XFS_AG_RESV_NONE, - ((bflags & XFS_BMAPI_NODISCARD) || - del->br_state == XFS_EXT_UNWRITTEN)); + XFS_AG_RESV_NONE, efi_flags); if (error) return error; } diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c index 0a5020c8e0f5e..a6de8b7528aa1 100644 --- a/fs/xfs/libxfs/xfs_bmap_btree.c +++ b/fs/xfs/libxfs/xfs_bmap_btree.c @@ -271,7 +271,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, false); + XFS_AG_RESV_NONE, 0); if (error) return error; diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c index 7278392a8f949..46c0bb67e4c47 100644 --- a/fs/xfs/libxfs/xfs_ialloc.c +++ b/fs/xfs/libxfs/xfs_ialloc.c @@ -1965,7 +1965,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, false); + XFS_AG_RESV_NONE, 0); } /* holemask is only 16-bits (fits in an unsigned long) */ @@ -2011,8 +2011,7 @@ 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, - false); + &XFS_RMAP_OINFO_INODES, XFS_AG_RESV_NONE, 0); if (error) return error; diff --git a/fs/xfs/libxfs/xfs_ialloc_btree.c b/fs/xfs/libxfs/xfs_ialloc_btree.c index 4a220946d99ca..bb6d4eb6698ca 100644 --- a/fs/xfs/libxfs/xfs_ialloc_btree.c +++ b/fs/xfs/libxfs/xfs_ialloc_btree.c @@ -161,7 +161,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, false); + &XFS_RMAP_OINFO_INOBT, resv, 0); } STATIC int diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c index 90a4526fef929..e30c4cdfaa392 100644 --- a/fs/xfs/libxfs/xfs_refcount.c +++ b/fs/xfs/libxfs/xfs_refcount.c @@ -1173,7 +1173,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, false); + XFS_AG_RESV_NONE, 0); if (error) goto out_error; } @@ -1237,7 +1237,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, false); + XFS_AG_RESV_NONE, 0); if (error) goto out_error; } @@ -2022,7 +2022,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, false); + XFS_AG_RESV_NONE, 0); if (error) goto out_trans; diff --git a/fs/xfs/libxfs/xfs_refcount_btree.c b/fs/xfs/libxfs/xfs_refcount_btree.c index ce42ecd3e3715..c2e20854f9bc2 100644 --- a/fs/xfs/libxfs/xfs_refcount_btree.c +++ b/fs/xfs/libxfs/xfs_refcount_btree.c @@ -108,7 +108,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, false); + &XFS_RMAP_OINFO_REFC, XFS_AG_RESV_METADATA, 0); } STATIC int diff --git a/fs/xfs/scrub/newbt.c b/fs/xfs/scrub/newbt.c index ad2da235d21bb..8375c8b9752a7 100644 --- a/fs/xfs/scrub/newbt.c +++ b/fs/xfs/scrub/newbt.c @@ -160,7 +160,8 @@ xrep_newbt_add_blocks( if (args->tp) { ASSERT(xnr->oinfo.oi_offset == 0); - error = xfs_alloc_schedule_autoreap(args, true, &resv->autoreap); + error = xfs_alloc_schedule_autoreap(args, + XFS_FREE_EXTENT_SKIP_DISCARD, &resv->autoreap); if (error) goto out_pag; } @@ -414,7 +415,7 @@ xrep_newbt_free_extent( */ fsbno = XFS_AGB_TO_FSB(sc->mp, resv->pag->pag_agno, free_agbno); error = xfs_free_extent_later(sc->tp, fsbno, free_aglen, &xnr->oinfo, - xnr->resv, true); + xnr->resv, XFS_FREE_EXTENT_SKIP_DISCARD); if (error) return error; diff --git a/fs/xfs/scrub/reap.c b/fs/xfs/scrub/reap.c index 01ceaa4efa16b..37eb61906be18 100644 --- a/fs/xfs/scrub/reap.c +++ b/fs/xfs/scrub/reap.c @@ -451,7 +451,7 @@ xreap_agextent_iter( xfs_refcount_free_cow_extent(sc->tp, fsbno, *aglenp); error = xfs_free_extent_later(sc->tp, fsbno, *aglenp, NULL, - rs->resv, true); + rs->resv, XFS_FREE_EXTENT_SKIP_DISCARD); if (error) return error; @@ -477,7 +477,7 @@ xreap_agextent_iter( * system with large EFIs. */ error = xfs_free_extent_later(sc->tp, fsbno, *aglenp, rs->oinfo, - rs->resv, true); + rs->resv, XFS_FREE_EXTENT_SKIP_DISCARD); if (error) return error; @@ -943,7 +943,8 @@ xrep_reap_bmapi_iter( xfs_trans_mod_dquot_byino(sc->tp, ip, XFS_TRANS_DQ_BCOUNT, -(int64_t)imap->br_blockcount); return xfs_free_extent_later(sc->tp, imap->br_startblock, - imap->br_blockcount, NULL, XFS_AG_RESV_NONE, true); + imap->br_blockcount, NULL, XFS_AG_RESV_NONE, + XFS_FREE_EXTENT_SKIP_DISCARD); } /* diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c index 69dfd7e430fe7..7e9273cc16e14 100644 --- a/fs/xfs/xfs_reflink.c +++ b/fs/xfs/xfs_reflink.c @@ -619,7 +619,7 @@ xfs_reflink_cancel_cow_blocks( error = xfs_free_extent_later(*tpp, del.br_startblock, del.br_blockcount, NULL, - XFS_AG_RESV_NONE, false); + XFS_AG_RESV_NONE, 0); if (error) break; From patchwork Sun Dec 31 21:27:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13507646 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C6AFBA22 for ; Sun, 31 Dec 2023 21:27:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EyQ4KNvU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3C67C433C7; Sun, 31 Dec 2023 21:27:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704058025; bh=i1QN7aF43H/9EcAB919vyrBARlvIICG5rOe97cW7rxY=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=EyQ4KNvUq9IjwHi8bBfEvsmJzOXl4/NgG4dSCzVtBQUA4z+w2DZ0Lb85cNnEZJxpH T+eDVTW1/5ykD1gq93g2WYtt1oj8r7VPM/op1cY35hDk5moG8uEvFKyevM8iPRd+Dm mey9ox+4LHL7GhwDWcpd3QoIyr2rK3WJMlX1SeUpU0CioweSz/6cvnE/H6TwVF2Qlo 8s/yQ8RjEYHjf44Omo7yqa0xtJDoDSwO0hLaJLJSz7kVyQ5nY+OBNKxLvGezjQHr41 yDo/lEwNREn1FbWU3gspmUfGO49pIztNT+lSqveGupIZy4PvfChKEc+ULfaNmEyXvx mbusnoZOMm9cA== Date: Sun, 31 Dec 2023 13:27:05 -0800 Subject: [PATCH 3/9] xfs: pass the fsbno to xfs_perag_intent_get From: "Darrick J. Wong" To: djwong@kernel.org Cc: Christoph Hellwig , linux-xfs@vger.kernel.org Message-ID: <170404848385.1764329.9186246888293070127.stgit@frogsfrogsfrogs> In-Reply-To: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> References: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Christoph Hellwig All callers of xfs_perag_intent_get have a fsbno and need boilerplate code to turn that into an agno. Just pass the fsbno to xfs_perag_intent_get and look up the agno there. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_bmap_item.c | 6 +----- fs/xfs/xfs_drain.c | 8 ++++---- fs/xfs/xfs_drain.h | 5 +++-- fs/xfs/xfs_extfree_item.c | 5 +---- fs/xfs/xfs_refcount_item.c | 5 +---- fs/xfs/xfs_rmap_item.c | 5 +---- 6 files changed, 11 insertions(+), 23 deletions(-) diff --git a/fs/xfs/xfs_bmap_item.c b/fs/xfs/xfs_bmap_item.c index 234296a37b269..e50276ceceae9 100644 --- a/fs/xfs/xfs_bmap_item.c +++ b/fs/xfs/xfs_bmap_item.c @@ -325,8 +325,6 @@ xfs_bmap_update_get_group( struct xfs_mount *mp, struct xfs_bmap_intent *bi) { - xfs_agnumber_t agno; - if (xfs_ifork_is_realtime(bi->bi_owner, bi->bi_whichfork)) { if (xfs_has_rtgroups(mp)) { xfs_rgnumber_t rgno; @@ -340,8 +338,6 @@ xfs_bmap_update_get_group( return; } - agno = XFS_FSB_TO_AGNO(mp, bi->bi_bmap.br_startblock); - /* * Bump the intent count on behalf of the deferred rmap and refcount * intent items that that we can queue when we finish this bmap work. @@ -349,7 +345,7 @@ xfs_bmap_update_get_group( * intent drops the intent count, ensuring that the intent count * remains nonzero across the transaction roll. */ - bi->bi_pag = xfs_perag_intent_get(mp, agno); + bi->bi_pag = xfs_perag_intent_get(mp, bi->bi_bmap.br_startblock); } /* Add this deferred BUI to the transaction. */ diff --git a/fs/xfs/xfs_drain.c b/fs/xfs/xfs_drain.c index 005a66be44a25..7bdb9688c0f5e 100644 --- a/fs/xfs/xfs_drain.c +++ b/fs/xfs/xfs_drain.c @@ -94,17 +94,17 @@ static inline int xfs_defer_drain_wait(struct xfs_defer_drain *dr) } /* - * Get a passive reference to an AG and declare an intent to update its - * metadata. + * Get a passive reference to the AG that contains a fsbno and declare an intent + * to update its metadata. */ struct xfs_perag * xfs_perag_intent_get( struct xfs_mount *mp, - xfs_agnumber_t agno) + xfs_fsblock_t fsbno) { struct xfs_perag *pag; - pag = xfs_perag_get(mp, agno); + pag = xfs_perag_get(mp, XFS_FSB_TO_AGNO(mp, fsbno)); if (!pag) return NULL; diff --git a/fs/xfs/xfs_drain.h b/fs/xfs/xfs_drain.h index 50a5772a8296c..775164f54ea6d 100644 --- a/fs/xfs/xfs_drain.h +++ b/fs/xfs/xfs_drain.h @@ -62,7 +62,7 @@ void xfs_drain_wait_enable(void); * until the item is finished or cancelled. */ struct xfs_perag *xfs_perag_intent_get(struct xfs_mount *mp, - xfs_agnumber_t agno); + xfs_fsblock_t fsbno); void xfs_perag_intent_put(struct xfs_perag *pag); void xfs_perag_intent_hold(struct xfs_perag *pag); @@ -76,7 +76,8 @@ struct xfs_defer_drain { /* empty */ }; #define xfs_defer_drain_free(dr) ((void)0) #define xfs_defer_drain_init(dr) ((void)0) -#define xfs_perag_intent_get(mp, agno) xfs_perag_get((mp), (agno)) +#define xfs_perag_intent_get(mp, fsbno) \ + xfs_perag_get((mp), XFS_FSB_TO_AGNO(mp, fsbno)) #define xfs_perag_intent_put(pag) xfs_perag_put(pag) static inline void xfs_perag_intent_hold(struct xfs_perag *pag) { } diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c index 190d6a69e40b0..a29105583de96 100644 --- a/fs/xfs/xfs_extfree_item.c +++ b/fs/xfs/xfs_extfree_item.c @@ -424,10 +424,7 @@ xfs_extent_free_get_group( struct xfs_mount *mp, struct xfs_extent_free_item *xefi) { - xfs_agnumber_t agno; - - agno = XFS_FSB_TO_AGNO(mp, xefi->xefi_startblock); - xefi->xefi_pag = xfs_perag_intent_get(mp, agno); + xefi->xefi_pag = xfs_perag_intent_get(mp, xefi->xefi_startblock); } /* Release a passive AG ref after some freeing work. */ diff --git a/fs/xfs/xfs_refcount_item.c b/fs/xfs/xfs_refcount_item.c index 20ad8086da60b..ff1fdb759a8d2 100644 --- a/fs/xfs/xfs_refcount_item.c +++ b/fs/xfs/xfs_refcount_item.c @@ -330,10 +330,7 @@ xfs_refcount_update_get_group( struct xfs_mount *mp, struct xfs_refcount_intent *ri) { - xfs_agnumber_t agno; - - agno = XFS_FSB_TO_AGNO(mp, ri->ri_startblock); - ri->ri_pag = xfs_perag_intent_get(mp, agno); + ri->ri_pag = xfs_perag_intent_get(mp, ri->ri_startblock); } /* Release a passive AG ref after finishing refcounting work. */ diff --git a/fs/xfs/xfs_rmap_item.c b/fs/xfs/xfs_rmap_item.c index 79ad0087aecaf..183544ac74c98 100644 --- a/fs/xfs/xfs_rmap_item.c +++ b/fs/xfs/xfs_rmap_item.c @@ -355,10 +355,7 @@ xfs_rmap_update_get_group( struct xfs_mount *mp, struct xfs_rmap_intent *ri) { - xfs_agnumber_t agno; - - agno = XFS_FSB_TO_AGNO(mp, ri->ri_bmap.br_startblock); - ri->ri_pag = xfs_perag_intent_get(mp, agno); + ri->ri_pag = xfs_perag_intent_get(mp, ri->ri_bmap.br_startblock); } /* Release a passive AG ref after finishing rmapping work. */ From patchwork Sun Dec 31 21:27:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13507647 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3A31BA22 for ; Sun, 31 Dec 2023 21:27:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Mcz1zoMc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C37DC433C7; Sun, 31 Dec 2023 21:27:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704058041; bh=dpJjPEG7qhz3yPCXBrPLeaEP1XcqcItWX4OnQVYforQ=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=Mcz1zoMcNp46JD5uKBX0282auRj3VIb+VJUH3Uy+2yJ+pixFdDMIPop1cecx/UpPa MitUKtZrHpsY0MhdofYB6xSJSXOeiGFmhOSkOBGwYVOR0UxVEmdE4DWxt571EdWvUx FGJkyVcuLtxYYawefEh9o+0lDgCErErH7xbpUwcVzWgmLHbpWV3X4G8r6e5TnB2XqS HE1uF71a/00Uux3c9GBu8Hcdqf+oU/SG6hnCOESinc/N4gwyZH46kJ7yYA3hInAvn8 +bpCxAmXEAjrEcSXxbTRy5gYD01c52GGQ1AQHTmkNDO5tuil4/bAr6qA7vxvRj4jum vBWTMV9hVmY8g== Date: Sun, 31 Dec 2023 13:27:20 -0800 Subject: [PATCH 4/9] xfs: add a xefi_entry helper From: "Darrick J. Wong" To: djwong@kernel.org Cc: Christoph Hellwig , linux-xfs@vger.kernel.org Message-ID: <170404848401.1764329.14466513813180386601.stgit@frogsfrogsfrogs> In-Reply-To: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> References: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Christoph Hellwig Add a helper to translate from the item list head to the xfs_extent_free_item structure and use it so shorten assignments and avoid the need for extra local variables. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_extfree_item.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c index a29105583de96..d86ec1d5e468a 100644 --- a/fs/xfs/xfs_extfree_item.c +++ b/fs/xfs/xfs_extfree_item.c @@ -303,6 +303,11 @@ static const struct xfs_item_ops xfs_efd_item_ops = { .iop_intent = xfs_efd_item_intent, }; +static inline struct xfs_extent_free_item *xefi_entry(const struct list_head *e) +{ + return list_entry(e, struct xfs_extent_free_item, xefi_list); +} + /* * Fill the EFD with all extents from the EFI when we need to roll the * transaction and continue with a new EFI. @@ -338,11 +343,8 @@ xfs_extent_free_diff_items( const struct list_head *a, const struct list_head *b) { - struct xfs_extent_free_item *ra; - struct xfs_extent_free_item *rb; - - ra = container_of(a, struct xfs_extent_free_item, xefi_list); - rb = container_of(b, struct xfs_extent_free_item, xefi_list); + struct xfs_extent_free_item *ra = xefi_entry(a); + struct xfs_extent_free_item *rb = xefi_entry(b); return ra->xefi_pag->pag_agno - rb->xefi_pag->pag_agno; } @@ -444,7 +446,7 @@ xfs_extent_free_finish_item( struct xfs_btree_cur **state) { struct xfs_owner_info oinfo = { }; - struct xfs_extent_free_item *xefi; + struct xfs_extent_free_item *xefi = xefi_entry(item); struct xfs_efd_log_item *efdp = EFD_ITEM(done); struct xfs_mount *mp = tp->t_mountp; struct xfs_extent *extp; @@ -452,7 +454,6 @@ xfs_extent_free_finish_item( xfs_agblock_t agbno; int error = 0; - xefi = container_of(item, struct xfs_extent_free_item, xefi_list); agbno = XFS_FSB_TO_AGBNO(mp, xefi->xefi_startblock); oinfo.oi_owner = xefi->xefi_owner; @@ -504,9 +505,7 @@ STATIC void xfs_extent_free_cancel_item( struct list_head *item) { - struct xfs_extent_free_item *xefi; - - xefi = container_of(item, struct xfs_extent_free_item, xefi_list); + struct xfs_extent_free_item *xefi = xefi_entry(item); xfs_extent_free_put_group(xefi); kmem_cache_free(xfs_extfree_item_cache, xefi); @@ -526,14 +525,13 @@ xfs_agfl_free_finish_item( struct xfs_owner_info oinfo = { }; struct xfs_mount *mp = tp->t_mountp; struct xfs_efd_log_item *efdp = EFD_ITEM(done); - struct xfs_extent_free_item *xefi; + struct xfs_extent_free_item *xefi = xefi_entry(item); struct xfs_extent *extp; struct xfs_buf *agbp; int error; xfs_agblock_t agbno; uint next_extent; - xefi = container_of(item, struct xfs_extent_free_item, xefi_list); ASSERT(xefi->xefi_blockcount == 1); agbno = XFS_FSB_TO_AGBNO(mp, xefi->xefi_startblock); oinfo.oi_owner = xefi->xefi_owner; From patchwork Sun Dec 31 21:27:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13507648 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50C5FBA22 for ; Sun, 31 Dec 2023 21:27:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XKv4YhEZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 213ABC433C7; Sun, 31 Dec 2023 21:27:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704058057; bh=Y1LWVPL1nPeE4qoUKc8pf7a7GyjMgwDNpWXN3vbT/Xw=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=XKv4YhEZzSk5djXGRGk+obRKdRAGhSCACnBbgKfmRxdbm+62hlB7eTYXR6woalsZ4 2fRg4xY+V5NfPRTI377Jh1Lkt9OnzNIK+5mV9seVZaUc2qlv0H7Zo5tK7iQCBcK0u2 oExvt6CV09PO9GFfFKETfvSLf0jSeTfpOlOqX9rBfcDY212AhBd89Jv92yV/OCYH5U O+ZDES0jTMM/hpBkcdRtAX+24SFqIA+hWiq5G55TmYZgmKQqHXn74AgXLrnbAxPfVR XDArBPoj+CnJEWuUG0jxsWhQBoRS/rEez8RzDP92ibY6hAeJE/5C63rRkL0Z0a07MZ c0M6HQO8ni6Uw== Date: Sun, 31 Dec 2023 13:27:36 -0800 Subject: [PATCH 5/9] xfs: reuse xfs_extent_free_cancel_item From: "Darrick J. Wong" To: djwong@kernel.org Cc: Christoph Hellwig , linux-xfs@vger.kernel.org Message-ID: <170404848417.1764329.4025148745846475029.stgit@frogsfrogsfrogs> In-Reply-To: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> References: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Christoph Hellwig Reuse xfs_extent_free_cancel_item to put the AG/RTG and free the item in a few places that currently open code the logic. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_extfree_item.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c index d86ec1d5e468a..9d141b9876572 100644 --- a/fs/xfs/xfs_extfree_item.c +++ b/fs/xfs/xfs_extfree_item.c @@ -437,6 +437,17 @@ xfs_extent_free_put_group( xfs_perag_intent_put(xefi->xefi_pag); } +/* Cancel a free extent. */ +STATIC void +xfs_extent_free_cancel_item( + struct list_head *item) +{ + struct xfs_extent_free_item *xefi = xefi_entry(item); + + xfs_extent_free_put_group(xefi); + kmem_cache_free(xfs_extfree_item_cache, xefi); +} + /* Process a free extent. */ STATIC int xfs_extent_free_finish_item( @@ -487,8 +498,7 @@ xfs_extent_free_finish_item( extp->ext_len = xefi->xefi_blockcount; efdp->efd_next_extent++; - xfs_extent_free_put_group(xefi); - kmem_cache_free(xfs_extfree_item_cache, xefi); + xfs_extent_free_cancel_item(item); return error; } @@ -500,17 +510,6 @@ xfs_extent_free_abort_intent( xfs_efi_release(EFI_ITEM(intent)); } -/* Cancel a free extent. */ -STATIC void -xfs_extent_free_cancel_item( - struct list_head *item) -{ - struct xfs_extent_free_item *xefi = xefi_entry(item); - - xfs_extent_free_put_group(xefi); - kmem_cache_free(xfs_extfree_item_cache, xefi); -} - /* * AGFL blocks are accounted differently in the reserve pools and are not * inserted into the busy extent list. @@ -550,8 +549,7 @@ xfs_agfl_free_finish_item( extp->ext_len = xefi->xefi_blockcount; efdp->efd_next_extent++; - xfs_extent_free_put_group(xefi); - kmem_cache_free(xfs_extfree_item_cache, xefi); + xfs_extent_free_cancel_item(&xefi->xefi_list); return error; } From patchwork Sun Dec 31 21:27:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13507649 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61183BA2B for ; Sun, 31 Dec 2023 21:27:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JZbodacp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4606C433C8; Sun, 31 Dec 2023 21:27:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704058072; bh=ygi/eQdVo9B8BclWm4x8gvybxVeDqDnSvV2ChTK/dR0=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=JZbodacpNo9oDekeM+INIsOYqTYVVgyJ0fZuuHtOvywesjYMLBmeaA7x1ZlqDoPy+ QAeSEhkyMsu7IdjKC1l753u9Gn6VUgSUTDfMu3wJM+UbdVIqlQ3vLsiyy5+vNYEbU8 yu+IVh31Oxi6QGf8ccTgSYDYvwj+KVLkG4y6LnSyehYFnJqcx0J7eStLqxJiXeWLe4 o41+c7Ba0yqrXXXCUiiQIfzx0O2N5s+FWqiRkaKOlHyK71OmSCQWwJel4vbLv0934R oPhnQHIay2Y5g8JpNBTL/oiJmSfpB3uCvG5xLW9seN2p3ObzyC/T88I9Eqw4RlCAS1 h3zJsNcUHwPAw== Date: Sun, 31 Dec 2023 13:27:52 -0800 Subject: [PATCH 6/9] xfs: factor out a xfs_efd_add_extent helper From: "Darrick J. Wong" To: djwong@kernel.org Cc: Christoph Hellwig , linux-xfs@vger.kernel.org Message-ID: <170404848433.1764329.14224111487773657261.stgit@frogsfrogsfrogs> In-Reply-To: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> References: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Christoph Hellwig Factor out a helper to add an extent to and EFD instead of duplicating the logic in two places. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_extfree_item.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c index 9d141b9876572..be932390bd1f7 100644 --- a/fs/xfs/xfs_extfree_item.c +++ b/fs/xfs/xfs_extfree_item.c @@ -336,6 +336,22 @@ xfs_efd_from_efi( efdp->efd_next_extent = efip->efi_format.efi_nextents; } +static void +xfs_efd_add_extent( + struct xfs_efd_log_item *efdp, + struct xfs_extent_free_item *xefi) +{ + struct xfs_extent *extp; + + ASSERT(efdp->efd_next_extent < efdp->efd_format.efd_nextents); + + extp = &efdp->efd_format.efd_extents[efdp->efd_next_extent]; + extp->ext_start = xefi->xefi_startblock; + extp->ext_len = xefi->xefi_blockcount; + + efdp->efd_next_extent++; +} + /* Sort bmap items by AG. */ static int xfs_extent_free_diff_items( @@ -460,8 +476,6 @@ xfs_extent_free_finish_item( struct xfs_extent_free_item *xefi = xefi_entry(item); struct xfs_efd_log_item *efdp = EFD_ITEM(done); struct xfs_mount *mp = tp->t_mountp; - struct xfs_extent *extp; - uint next_extent; xfs_agblock_t agbno; int error = 0; @@ -490,14 +504,7 @@ xfs_extent_free_finish_item( return error; } - /* Add the work we finished to the EFD, even though nobody uses that */ - next_extent = efdp->efd_next_extent; - ASSERT(next_extent < efdp->efd_format.efd_nextents); - extp = &(efdp->efd_format.efd_extents[next_extent]); - extp->ext_start = xefi->xefi_startblock; - extp->ext_len = xefi->xefi_blockcount; - efdp->efd_next_extent++; - + xfs_efd_add_extent(efdp, xefi); xfs_extent_free_cancel_item(item); return error; } @@ -525,11 +532,9 @@ xfs_agfl_free_finish_item( struct xfs_mount *mp = tp->t_mountp; struct xfs_efd_log_item *efdp = EFD_ITEM(done); struct xfs_extent_free_item *xefi = xefi_entry(item); - struct xfs_extent *extp; struct xfs_buf *agbp; int error; xfs_agblock_t agbno; - uint next_extent; ASSERT(xefi->xefi_blockcount == 1); agbno = XFS_FSB_TO_AGBNO(mp, xefi->xefi_startblock); @@ -542,13 +547,7 @@ xfs_agfl_free_finish_item( error = xfs_free_agfl_block(tp, xefi->xefi_pag->pag_agno, agbno, agbp, &oinfo); - next_extent = efdp->efd_next_extent; - ASSERT(next_extent < efdp->efd_format.efd_nextents); - extp = &(efdp->efd_format.efd_extents[next_extent]); - extp->ext_start = xefi->xefi_startblock; - extp->ext_len = xefi->xefi_blockcount; - efdp->efd_next_extent++; - + xfs_efd_add_extent(efdp, xefi); xfs_extent_free_cancel_item(&xefi->xefi_list); return error; } From patchwork Sun Dec 31 21:28:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13507650 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 192D2BA2B for ; Sun, 31 Dec 2023 21:28:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qqMh+RfY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87DB8C433C7; Sun, 31 Dec 2023 21:28:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704058088; bh=pE9hGw4Dw5FT57NpeeXPsRcpYjASXlR0QprFACY5PPU=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=qqMh+RfYoFKDbeWYmT27/Knczc6xz4lpxk2pR80rtLDsOq4k/RYHZnYeVvuJPdVMs va/uJf24Ex8OvKbSLtlK8WAOzHicQg5OSRGhLm/u3y92urcD6berDV8ExT6JfzrW/0 Vc6e3BccylDHdH/q5u/+Hkdp99EW/womOa7WGfJASYFCPO4nh01lDHZnbX3ZGVybVM RjkAsKslWfr4GWbyzyuyHiIrEFAdqGFhSLe0DicD2q3OAqC+X2cyMP2sBjzVZgWjV7 tqYpz0pYrPduxj7RM23ucR2aIE6RPWDEd0uHt0VSxyS5MfIBjhgvb+l8+U38cN3AiU 0M3NKefqO6z4Q== Date: Sun, 31 Dec 2023 13:28:08 -0800 Subject: [PATCH 7/9] xfs: remove duplicate asserts in xfs_defer_extent_free From: "Darrick J. Wong" To: djwong@kernel.org Cc: Christoph Hellwig , linux-xfs@vger.kernel.org Message-ID: <170404848448.1764329.7946844448940228128.stgit@frogsfrogsfrogs> In-Reply-To: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> References: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Christoph Hellwig The bno/len verification is already done by the calls to xfs_verify_rtbext / xfs_verify_fsbext, and reporting a corruption error seem like the better handling than tripping an assert anyway. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_alloc.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c index 1ea88d4675f5f..ca4df5e0b2a31 100644 --- a/fs/xfs/libxfs/xfs_alloc.c +++ b/fs/xfs/libxfs/xfs_alloc.c @@ -2596,23 +2596,10 @@ xfs_defer_extent_free( { struct xfs_extent_free_item *xefi; struct xfs_mount *mp = tp->t_mountp; -#ifdef DEBUG - xfs_agnumber_t agno; - xfs_agblock_t agbno; - ASSERT(bno != NULLFSBLOCK); - ASSERT(len > 0); ASSERT(len <= XFS_MAX_BMBT_EXTLEN); ASSERT(!isnullstartblock(bno)); - agno = XFS_FSB_TO_AGNO(mp, bno); - agbno = XFS_FSB_TO_AGBNO(mp, bno); - ASSERT(agno < mp->m_sb.sb_agcount); - ASSERT(agbno < mp->m_sb.sb_agblocks); - ASSERT(len < mp->m_sb.sb_agblocks); - ASSERT(agbno + len <= mp->m_sb.sb_agblocks); -#endif ASSERT(!(free_flags & ~XFS_FREE_EXTENT_ALL_FLAGS)); - ASSERT(xfs_extfree_item_cache != NULL); ASSERT(type != XFS_AG_RESV_AGFL); if (XFS_IS_CORRUPT(mp, !xfs_verify_fsbext(mp, bno, len))) From patchwork Sun Dec 31 21:28:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13507651 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E59EBA22 for ; Sun, 31 Dec 2023 21:28:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Z4gk7Oun" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30D75C433C8; Sun, 31 Dec 2023 21:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704058104; bh=W/6jn+quTdDPnBCZesEYPPPgNI0Xr8F+lM/xcvhPvd8=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=Z4gk7Ouna7TAzQFp3neMSnclucY3u9iT0rUYTITWzRE7OLt2RXiu2+5MrqGPIFXAP q8CSv0444H59GGL8X/A/VVIvYjPWqwZlJ6d5y1SB5LAKDY+tijwUzXTfDNXLWdXPN7 dzx4KaQyJzGjwCEPPCd/lH+a1mNBztuJbTdjbDBBiHpqhUOxQDBF+NuM4HwsYDe+7P HJtW/Xf/XK9zhGGaEvDXFwXB5DD4uF42HlmX+lQ3hspz9Vfd3Afm70fxlnnY009wSK 8YBcAP/8wHIx+RSJXrBvTzxrFGmNJ4o34LA2ei86DFTcZykw8BXymPOJUH8ss+367w +z2IEX5NB6IUw== Date: Sun, 31 Dec 2023 13:28:23 -0800 Subject: [PATCH 8/9] xfs: remove xfs_defer_agfl_block From: "Darrick J. Wong" To: djwong@kernel.org Cc: Christoph Hellwig , linux-xfs@vger.kernel.org Message-ID: <170404848464.1764329.16504824624090286076.stgit@frogsfrogsfrogs> In-Reply-To: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> References: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Christoph Hellwig xfs_free_extent_later can handle the extra AGFL special casing with very little extra logic. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_alloc.c | 67 +++++++++++++++------------------------------ 1 file changed, 22 insertions(+), 45 deletions(-) diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c index ca4df5e0b2a31..0227985676042 100644 --- a/fs/xfs/libxfs/xfs_alloc.c +++ b/fs/xfs/libxfs/xfs_alloc.c @@ -2538,48 +2538,6 @@ xfs_agfl_reset( clear_bit(XFS_AGSTATE_AGFL_NEEDS_RESET, &pag->pag_opstate); } -/* - * Defer an AGFL block free. This is effectively equivalent to - * xfs_free_extent_later() with some special handling particular to AGFL blocks. - * - * Deferring AGFL frees helps prevent log reservation overruns due to too many - * allocation operations in a transaction. AGFL frees are prone to this problem - * because for one they are always freed one at a time. Further, an immediate - * AGFL block free can cause a btree join and require another block free before - * the real allocation can proceed. Deferring the free disconnects freeing up - * the AGFL slot from freeing the block. - */ -static int -xfs_defer_agfl_block( - struct xfs_trans *tp, - xfs_agnumber_t agno, - xfs_agblock_t agbno, - struct xfs_owner_info *oinfo) -{ - struct xfs_mount *mp = tp->t_mountp; - struct xfs_extent_free_item *xefi; - xfs_fsblock_t fsbno = XFS_AGB_TO_FSB(mp, agno, agbno); - - ASSERT(xfs_extfree_item_cache != NULL); - ASSERT(oinfo != NULL); - - if (XFS_IS_CORRUPT(mp, !xfs_verify_fsbno(mp, fsbno))) - return -EFSCORRUPTED; - - xefi = kmem_cache_zalloc(xfs_extfree_item_cache, - GFP_KERNEL | __GFP_NOFAIL); - xefi->xefi_startblock = fsbno; - xefi->xefi_blockcount = 1; - xefi->xefi_owner = oinfo->oi_owner; - xefi->xefi_agresv = XFS_AG_RESV_AGFL; - - trace_xfs_agfl_free_defer(mp, xefi); - - xfs_extent_free_get_group(mp, xefi); - xfs_defer_add(tp, &xefi->xefi_list, &xfs_agfl_free_defer_type); - return 0; -} - /* * Add the extent to the list of extents to be free at transaction end. * The list is maintained sorted (by block number). @@ -2627,7 +2585,13 @@ xfs_defer_extent_free( trace_xfs_extent_free_defer(mp, xefi); xfs_extent_free_get_group(mp, xefi); - *dfpp = xfs_defer_add(tp, &xefi->xefi_list, &xfs_extent_free_defer_type); + + if (xefi->xefi_agresv == XFS_AG_RESV_AGFL) + *dfpp = xfs_defer_add(tp, &xefi->xefi_list, + &xfs_agfl_free_defer_type); + else + *dfpp = xfs_defer_add(tp, &xefi->xefi_list, + &xfs_extent_free_defer_type); return 0; } @@ -2885,8 +2849,21 @@ xfs_alloc_fix_freelist( if (error) goto out_agbp_relse; - /* defer agfl frees */ - error = xfs_defer_agfl_block(tp, args->agno, bno, &targs.oinfo); + /* + * Defer the AGFL block free. + * + * This helps to prevent log reservation overruns due to too + * many allocation operations in a transaction. AGFL frees are + * prone to this problem because for one they are always freed + * one at a time. Further, an immediate AGFL block free can + * cause a btree join and require another block free before the + * real allocation can proceed. + * Deferring the free disconnects freeing up the AGFL slot from + * freeing the block. + */ + error = xfs_free_extent_later(tp, + XFS_AGB_TO_FSB(mp, args->agno, bno), 1, + &targs.oinfo, XFS_AG_RESV_AGFL, 0); if (error) goto out_agbp_relse; } From patchwork Sun Dec 31 21:28:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13507652 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0EC3BA2B for ; Sun, 31 Dec 2023 21:28:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZAhV904i" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BECB7C433C8; Sun, 31 Dec 2023 21:28:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704058119; bh=kg65gkM8tyxRFg6kAqK/7MHvY8mXvj0QGtmq38JHu78=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=ZAhV904ioPR22kftF6OAHfIlcgWwlrTAi3gf9myA3sgRQddtsj3mHQa3VLm9YJFDq IcM0CeVlPgpeFGVN2YgleqNXGc5ijEgMFyFBUVZkab7ywpZZgMbmFdKVRsKemcL+AU uVM3iBladXMgWcPqApVan7fkqyYGWYqhSFGvh5K6e24kvn2+jKjHdsyGHQ4cWqs6g8 vwUljnCvrdHFh35MHw5P5vyalT9lAMGdjJ7N/jo+3hk+Xitzzy8J+0zb60PJ2OrUWZ DOvL6QC2Qo4y2DYuAtb6h/jIyIsxfscLCsPXwhwyrtClVW6eJwk1DpLbXg1ucBIXc0 N/QToLBhEc4rg== Date: Sun, 31 Dec 2023 13:28:39 -0800 Subject: [PATCH 9/9] xfs: move xfs_extent_free_defer_add to xfs_extfree_item.c From: "Darrick J. Wong" To: djwong@kernel.org Cc: linux-xfs@vger.kernel.org Message-ID: <170404848480.1764329.1566640489700733204.stgit@frogsfrogsfrogs> In-Reply-To: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> References: <170404848314.1764329.10362480227353094080.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Move the code that adds the incore xfs_extent_free_item deferred work data to a transaction live with the EFI log item code. This means that the allocator code no longer has to know about the inner workings of the EFI log items. As a consequence, we can get rid of the _{get,put}_group helpers. Signed-off-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_alloc.c | 12 ++---------- fs/xfs/libxfs/xfs_alloc.h | 3 --- fs/xfs/xfs_extfree_item.c | 31 +++++++++++++++++-------------- fs/xfs/xfs_extfree_item.h | 6 ++++++ 4 files changed, 25 insertions(+), 27 deletions(-) diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c index 0227985676042..5d63711ad1aac 100644 --- a/fs/xfs/libxfs/xfs_alloc.c +++ b/fs/xfs/libxfs/xfs_alloc.c @@ -27,6 +27,7 @@ #include "xfs_ag_resv.h" #include "xfs_bmap.h" #include "xfs_health.h" +#include "xfs_extfree_item.h" struct kmem_cache *xfs_extfree_item_cache; @@ -2582,16 +2583,7 @@ xfs_defer_extent_free( xefi->xefi_owner = XFS_RMAP_OWN_NULL; } - trace_xfs_extent_free_defer(mp, xefi); - - xfs_extent_free_get_group(mp, xefi); - - if (xefi->xefi_agresv == XFS_AG_RESV_AGFL) - *dfpp = xfs_defer_add(tp, &xefi->xefi_list, - &xfs_agfl_free_defer_type); - else - *dfpp = xfs_defer_add(tp, &xefi->xefi_list, - &xfs_extent_free_defer_type); + xfs_extent_free_defer_add(tp, xefi, dfpp); return 0; } diff --git a/fs/xfs/libxfs/xfs_alloc.h b/fs/xfs/libxfs/xfs_alloc.h index 2da543fb90ecd..0ed71a31fe7ce 100644 --- a/fs/xfs/libxfs/xfs_alloc.h +++ b/fs/xfs/libxfs/xfs_alloc.h @@ -254,9 +254,6 @@ struct xfs_extent_free_item { enum xfs_ag_resv_type xefi_agresv; }; -void xfs_extent_free_get_group(struct xfs_mount *mp, - struct xfs_extent_free_item *xefi); - #define XFS_EFI_SKIP_DISCARD (1U << 0) /* don't issue discard */ #define XFS_EFI_ATTR_FORK (1U << 1) /* freeing attr fork block */ #define XFS_EFI_BMBT_BLOCK (1U << 2) /* freeing bmap btree block */ diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c index be932390bd1f7..e8569bf26819c 100644 --- a/fs/xfs/xfs_extfree_item.c +++ b/fs/xfs/xfs_extfree_item.c @@ -436,21 +436,24 @@ xfs_extent_free_create_done( return &efdp->efd_item; } -/* Take a passive ref to the AG containing the space we're freeing. */ +/* Add this deferred EFI to the transaction. */ void -xfs_extent_free_get_group( - struct xfs_mount *mp, - struct xfs_extent_free_item *xefi) +xfs_extent_free_defer_add( + struct xfs_trans *tp, + struct xfs_extent_free_item *xefi, + struct xfs_defer_pending **dfpp) { + struct xfs_mount *mp = tp->t_mountp; + + trace_xfs_extent_free_defer(mp, xefi); + xefi->xefi_pag = xfs_perag_intent_get(mp, xefi->xefi_startblock); -} - -/* Release a passive AG ref after some freeing work. */ -static inline void -xfs_extent_free_put_group( - struct xfs_extent_free_item *xefi) -{ - xfs_perag_intent_put(xefi->xefi_pag); + if (xefi->xefi_agresv == XFS_AG_RESV_AGFL) + *dfpp = xfs_defer_add(tp, &xefi->xefi_list, + &xfs_agfl_free_defer_type); + else + *dfpp = xfs_defer_add(tp, &xefi->xefi_list, + &xfs_extent_free_defer_type); } /* Cancel a free extent. */ @@ -460,7 +463,7 @@ xfs_extent_free_cancel_item( { struct xfs_extent_free_item *xefi = xefi_entry(item); - xfs_extent_free_put_group(xefi); + xfs_perag_intent_put(xefi->xefi_pag); kmem_cache_free(xfs_extfree_item_cache, xefi); } @@ -575,7 +578,7 @@ xfs_efi_recover_work( xefi->xefi_blockcount = extp->ext_len; xefi->xefi_agresv = XFS_AG_RESV_NONE; xefi->xefi_owner = XFS_RMAP_OWN_UNKNOWN; - xfs_extent_free_get_group(mp, xefi); + xefi->xefi_pag = xfs_perag_intent_get(mp, extp->ext_start); xfs_defer_add_item(dfp, &xefi->xefi_list); } diff --git a/fs/xfs/xfs_extfree_item.h b/fs/xfs/xfs_extfree_item.h index da6a5afa607cf..41b7c43060799 100644 --- a/fs/xfs/xfs_extfree_item.h +++ b/fs/xfs/xfs_extfree_item.h @@ -88,4 +88,10 @@ xfs_efd_log_item_sizeof( extern struct kmem_cache *xfs_efi_cache; extern struct kmem_cache *xfs_efd_cache; +struct xfs_extent_free_item; + +void xfs_extent_free_defer_add(struct xfs_trans *tp, + struct xfs_extent_free_item *xefi, + struct xfs_defer_pending **dfpp); + #endif /* __XFS_EXTFREE_ITEM_H__ */