diff options
author | Long Li <leo.lilong@huawei.com> | 2024-02-15 09:27:53 +0100 |
---|---|---|
committer | Carlos Maiolino <cem@kernel.org> | 2024-02-15 12:56:43 +0100 |
commit | bb98a33c1e8debe33505d8e2b7b4fdbe24d4b6cf (patch) | |
tree | b0abdbf570815d418b9a3dc81e831f7bfad15cb1 | |
parent | 35c3aa608b5b00492e6b99354fe0af52fabb266c (diff) | |
download | xfsprogs-dev-bb98a33c1e8debe33505d8e2b7b4fdbe24d4b6cf.tar.gz |
xfs: factor out xfs_defer_pending_abort
Source kernel commit: 2a5db859c6825b5d50377dda9c3cc729c20cad43
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>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
-rw-r--r-- | libxfs/xfs_defer.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/libxfs/xfs_defer.c b/libxfs/xfs_defer.c index 77a94f58f4..16060ef883 100644 --- a/libxfs/xfs_defer.c +++ b/libxfs/xfs_defer.c @@ -240,21 +240,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; @@ -262,6 +259,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. |