mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 04:04:06 +00:00
xfs: factor out xfs_defer_pending_abort
commit 2a5db859c6825b5d50377dda9c3cc729c20cad43 upstream. 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: Catherine Hoang <catherine.hoang@oracle.com> Acked-by: Chandan Babu R <chandanbabu@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
d7d84772c3
commit
23f3d79fc9
1 changed files with 20 additions and 13 deletions
|
@ -245,26 +245,33 @@ xfs_defer_create_intents(
|
|||
return ret;
|
||||
}
|
||||
|
||||
STATIC void
|
||||
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;
|
||||
|
||||
/* Abort intent items that don't have a done item. */
|
||||
list_for_each_entry(dfp, dop_list, dfp_list) {
|
||||
ops = defer_op_types[dfp->dfp_type];
|
||||
trace_xfs_defer_pending_abort(mp, dfp);
|
||||
if (dfp->dfp_intent && !dfp->dfp_done) {
|
||||
ops->abort_intent(dfp->dfp_intent);
|
||||
dfp->dfp_intent = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Abort all the intents that were committed. */
|
||||
STATIC void
|
||||
xfs_defer_trans_abort(
|
||||
struct xfs_trans *tp,
|
||||
struct list_head *dop_pending)
|
||||
{
|
||||
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) {
|
||||
ops = defer_op_types[dfp->dfp_type];
|
||||
trace_xfs_defer_pending_abort(tp->t_mountp, dfp);
|
||||
if (dfp->dfp_intent && !dfp->dfp_done) {
|
||||
ops->abort_intent(dfp->dfp_intent);
|
||||
dfp->dfp_intent = NULL;
|
||||
}
|
||||
}
|
||||
xfs_defer_pending_abort(tp->t_mountp, dop_pending);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue