From: "Darrick J. Wong" <djwong@kernel.org>
To: Long Li <leo.lilong@huawei.com>
Cc: david@fromorbit.com, linux-xfs@vger.kernel.org,
yi.zhang@huawei.com, houtao1@huawei.com, yangerkun@huawei.com
Subject: Re: [PATCH v2 1/3] xfs: factor out xfs_defer_pending_abort
Date: Tue, 18 Jul 2023 19:08:11 -0700 [thread overview]
Message-ID: <20230719020811.GE11352@frogsfrogsfrogs> (raw)
In-Reply-To: <20230715063647.2094989-2-leo.lilong@huawei.com>
On Sat, Jul 15, 2023 at 02:36:45PM +0800, Long Li wrote:
> Factor out xfs_defer_pending_abort() from xfs_defer_trans_abort(), which
> not use transaction parameter, so it can be used after the transaction
> life cycle.
>
> Signed-off-by: Long Li <leo.lilong@huawei.com>
Pretty straightforward slicing and dicing, so
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> ---
> fs/xfs/libxfs/xfs_defer.c | 23 +++++++++++++++--------
> 1 file changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c
> index bcfb6a4203cd..88388e12f8e7 100644
> --- a/fs/xfs/libxfs/xfs_defer.c
> +++ b/fs/xfs/libxfs/xfs_defer.c
> @@ -245,21 +245,18 @@ xfs_defer_create_intents(
> return ret;
> }
>
> -/* Abort all the intents that were committed. */
> STATIC void
> -xfs_defer_trans_abort(
> - struct xfs_trans *tp,
> - struct list_head *dop_pending)
> +xfs_defer_pending_abort(
> + struct xfs_mount *mp,
> + struct list_head *dop_list)
> {
> struct xfs_defer_pending *dfp;
> const struct xfs_defer_op_type *ops;
>
> - trace_xfs_defer_trans_abort(tp, _RET_IP_);
> -
> /* Abort intent items that don't have a done item. */
> - list_for_each_entry(dfp, dop_pending, dfp_list) {
> + list_for_each_entry(dfp, dop_list, dfp_list) {
> ops = defer_op_types[dfp->dfp_type];
> - trace_xfs_defer_pending_abort(tp->t_mountp, dfp);
> + trace_xfs_defer_pending_abort(mp, dfp);
> if (dfp->dfp_intent && !dfp->dfp_done) {
> ops->abort_intent(dfp->dfp_intent);
> dfp->dfp_intent = NULL;
> @@ -267,6 +264,16 @@ xfs_defer_trans_abort(
> }
> }
>
> +/* Abort all the intents that were committed. */
> +STATIC void
> +xfs_defer_trans_abort(
> + struct xfs_trans *tp,
> + struct list_head *dop_pending)
> +{
> + trace_xfs_defer_trans_abort(tp, _RET_IP_);
> + xfs_defer_pending_abort(tp->t_mountp, dop_pending);
> +}
> +
> /*
> * Capture resources that the caller said not to release ("held") when the
> * transaction commits. Caller is responsible for zero-initializing @dres.
> --
> 2.31.1
>
next prev parent reply other threads:[~2023-07-19 2:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-15 6:36 [PATCH v2 0/3] xfs: fix two problem when recovery intents fails Long Li
2023-07-15 6:36 ` [PATCH v2 1/3] xfs: factor out xfs_defer_pending_abort Long Li
2023-07-19 2:08 ` Darrick J. Wong [this message]
2023-07-15 6:36 ` [PATCH v2 2/3] xfs: abort intent items when recovery intents fail Long Li
2023-07-19 2:07 ` Darrick J. Wong
2023-07-15 6:36 ` [PATCH v2 3/3] xfs: make sure done item committed before cancel intents Long Li
2023-07-19 2:19 ` Darrick J. Wong
2023-07-22 2:16 ` Long Li
2023-07-19 6:41 ` Dave Chinner
2023-07-22 1:19 ` Long Li
2023-07-24 1:05 ` Dave Chinner
2023-07-25 12:25 ` Long Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230719020811.GE11352@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=david@fromorbit.com \
--cc=houtao1@huawei.com \
--cc=leo.lilong@huawei.com \
--cc=linux-xfs@vger.kernel.org \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox