Skip to content

Commit 2a5db85

Browse files
Long LiChandan Babu R
authored andcommitted
xfs: factor out xfs_defer_pending_abort
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 <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Chandan Babu R <[email protected]>
1 parent b85ea95 commit 2a5db85

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

fs/xfs/libxfs/xfs_defer.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,28 +245,35 @@ xfs_defer_create_intents(
245245
return ret;
246246
}
247247

248-
/* Abort all the intents that were committed. */
249248
STATIC void
250-
xfs_defer_trans_abort(
251-
struct xfs_trans *tp,
252-
struct list_head *dop_pending)
249+
xfs_defer_pending_abort(
250+
struct xfs_mount *mp,
251+
struct list_head *dop_list)
253252
{
254253
struct xfs_defer_pending *dfp;
255254
const struct xfs_defer_op_type *ops;
256255

257-
trace_xfs_defer_trans_abort(tp, _RET_IP_);
258-
259256
/* Abort intent items that don't have a done item. */
260-
list_for_each_entry(dfp, dop_pending, dfp_list) {
257+
list_for_each_entry(dfp, dop_list, dfp_list) {
261258
ops = defer_op_types[dfp->dfp_type];
262-
trace_xfs_defer_pending_abort(tp->t_mountp, dfp);
259+
trace_xfs_defer_pending_abort(mp, dfp);
263260
if (dfp->dfp_intent && !dfp->dfp_done) {
264261
ops->abort_intent(dfp->dfp_intent);
265262
dfp->dfp_intent = NULL;
266263
}
267264
}
268265
}
269266

267+
/* Abort all the intents that were committed. */
268+
STATIC void
269+
xfs_defer_trans_abort(
270+
struct xfs_trans *tp,
271+
struct list_head *dop_pending)
272+
{
273+
trace_xfs_defer_trans_abort(tp, _RET_IP_);
274+
xfs_defer_pending_abort(tp->t_mountp, dop_pending);
275+
}
276+
270277
/*
271278
* Capture resources that the caller said not to release ("held") when the
272279
* transaction commits. Caller is responsible for zero-initializing @dres.

0 commit comments

Comments
 (0)