xfs_trans_bhold(args.trans, leaf_bp);
xfs_defer_bjoin(args.trans->t_dfops, leaf_bp);
xfs_defer_ijoin(args.trans->t_dfops, dp);
- error = xfs_defer_finish(&args.trans, args.trans->t_dfops);
+ error = xfs_defer_finish(&args.trans);
if (error)
goto out;
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->trans->t_dfops, dp);
- error = xfs_defer_finish(&args->trans, args->trans->t_dfops);
+ error = xfs_defer_finish(&args->trans);
if (error)
goto out_defer_cancel;
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->trans->t_dfops, dp);
- error = xfs_defer_finish(&args->trans, args->trans->t_dfops);
+ error = xfs_defer_finish(&args->trans);
if (error)
goto out_defer_cancel;
}
}
return error;
out_defer_cancel:
- xfs_defer_cancel(args->trans->t_dfops);
+ xfs_defer_cancel(args->trans);
return error;
}
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->trans->t_dfops, dp);
- error = xfs_defer_finish(&args->trans, args->trans->t_dfops);
+ error = xfs_defer_finish(&args->trans);
if (error)
goto out_defer_cancel;
}
return 0;
out_defer_cancel:
- xfs_defer_cancel(args->trans->t_dfops);
+ xfs_defer_cancel(args->trans);
return error;
}
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->trans->t_dfops, dp);
- error = xfs_defer_finish(&args->trans,
- args->trans->t_dfops);
+ error = xfs_defer_finish(&args->trans);
if (error)
goto out_defer_cancel;
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->trans->t_dfops, dp);
- error = xfs_defer_finish(&args->trans, args->trans->t_dfops);
+ error = xfs_defer_finish(&args->trans);
if (error)
goto out_defer_cancel;
} else {
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->trans->t_dfops, dp);
- error = xfs_defer_finish(&args->trans, args->trans->t_dfops);
+ error = xfs_defer_finish(&args->trans);
if (error)
goto out_defer_cancel;
}
return error;
return retval;
out_defer_cancel:
- xfs_defer_cancel(args->trans->t_dfops);
+ xfs_defer_cancel(args->trans);
goto out;
}
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->trans->t_dfops, dp);
- error = xfs_defer_finish(&args->trans, args->trans->t_dfops);
+ error = xfs_defer_finish(&args->trans);
if (error)
goto out_defer_cancel;
/*
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->trans->t_dfops, dp);
- error = xfs_defer_finish(&args->trans, args->trans->t_dfops);
+ error = xfs_defer_finish(&args->trans);
if (error)
goto out_defer_cancel;
} else
xfs_da_state_free(state);
return error;
out_defer_cancel:
- xfs_defer_cancel(args->trans->t_dfops);
+ xfs_defer_cancel(args->trans);
goto out;
}
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->trans->t_dfops, dp);
- error = xfs_defer_finish(&args->trans, args->trans->t_dfops);
+ error = xfs_defer_finish(&args->trans);
if (error)
goto out_defer_cancel;
ASSERT(valuelen == 0);
return 0;
out_defer_cancel:
- xfs_defer_cancel(args->trans->t_dfops);
+ xfs_defer_cancel(args->trans);
return error;
}
if (error)
goto out_defer_cancel;
xfs_defer_ijoin(args->trans->t_dfops, args->dp);
- error = xfs_defer_finish(&args->trans, args->trans->t_dfops);
+ error = xfs_defer_finish(&args->trans);
if (error)
goto out_defer_cancel;
}
return 0;
out_defer_cancel:
- xfs_defer_cancel(args->trans->t_dfops);
+ xfs_defer_cancel(args->trans);
return error;
}
*/
int
xfs_defer_finish(
- struct xfs_trans **tp,
- struct xfs_defer_ops *dop)
+ struct xfs_trans **tp)
{
+ struct xfs_defer_ops *dop = (*tp)->t_dfops;
struct xfs_defer_pending *dfp;
struct list_head *li;
struct list_head *n;
void (*cleanup_fn)(struct xfs_trans *, void *, int);
ASSERT((*tp)->t_flags & XFS_TRANS_PERM_LOG_RES);
- ASSERT((*tp)->t_dfops == dop);
trace_xfs_defer_finish((*tp)->t_mountp, dop, _RET_IP_);
* Free up any items left in the list.
*/
void
-xfs_defer_cancel(
+__xfs_defer_cancel(
struct xfs_defer_ops *dop)
{
struct xfs_defer_pending *dfp;
void xfs_defer_add(struct xfs_defer_ops *dop, enum xfs_defer_ops_type type,
struct list_head *h);
-int xfs_defer_finish(struct xfs_trans **tp, struct xfs_defer_ops *dop);
-void xfs_defer_cancel(struct xfs_defer_ops *dop);
+int xfs_defer_finish(struct xfs_trans **tp);
+void __xfs_defer_cancel(struct xfs_defer_ops *dop);
void xfs_defer_init(struct xfs_trans *tp, struct xfs_defer_ops *dop);
bool xfs_defer_has_unfinished_work(struct xfs_defer_ops *dop);
int xfs_defer_ijoin(struct xfs_defer_ops *dop, struct xfs_inode *ip);
goto out_defer;
xfs_defer_ijoin(tp->t_dfops, ip);
- error = xfs_defer_finish(tpp, tp->t_dfops);
+ error = xfs_defer_finish(tpp);
tp = *tpp;
if (error)
goto out_defer;
return 0;
out_defer:
- xfs_defer_cancel(tp->t_dfops);
+ xfs_defer_cancel(tp);
out:
trace_xfs_swap_extent_rmap_error(ip, error, _RET_IP_);
tip->i_d.di_flags2 = tip_flags2;
xfs_trans_brelse(tp, bp);
goto error1;
}
- error = xfs_defer_finish(tpp, tp->t_dfops);
+ error = xfs_defer_finish(tpp);
tp = *tpp;
if (error) {
xfs_buf_relse(bp);
return 0;
error1:
- xfs_defer_cancel(tp->t_dfops);
+ xfs_defer_cancel(tp);
error0:
return error;
}
* reservation and commit the old transaction.
*/
xfs_defer_ijoin(tp->t_dfops, ip);
- error = xfs_defer_finish(&tp, tp->t_dfops);
+ error = xfs_defer_finish(&tp);
if (error)
goto out_bmap_cancel;
* the transaction can be properly aborted. We just need to make sure
* we're not holding any resources that we were not when we came in.
*/
- xfs_defer_cancel(tp->t_dfops);
+ xfs_defer_cancel(tp);
goto out;
}
xfs_trans_ail_cursor_done(&cur);
spin_unlock(&ailp->ail_lock);
if (error)
- xfs_defer_cancel(&dfops);
+ __xfs_defer_cancel(&dfops);
else
error = xlog_finish_defer_ops(log->l_mp, &dfops);
/* Roll the transaction */
xfs_defer_ijoin((*tpp)->t_dfops, ip);
- error = xfs_defer_finish(tpp, (*tpp)->t_dfops);
+ error = xfs_defer_finish(tpp);
if (error) {
- xfs_defer_cancel((*tpp)->t_dfops);
+ xfs_defer_cancel(*tpp);
break;
}
xfs_bmap_del_extent_cow(ip, &icur, &got, &del);
xfs_defer_ijoin(tp->t_dfops, ip);
- error = xfs_defer_finish(&tp, tp->t_dfops);
+ error = xfs_defer_finish(&tp);
if (error)
goto out_cancel;
if (!xfs_iext_get_extent(ifp, &icur, &got))
next_extent:
/* Process all the deferred stuff. */
xfs_defer_ijoin(tp->t_dfops, ip);
- error = xfs_defer_finish(&tp, tp->t_dfops);
+ error = xfs_defer_finish(&tp);
if (error)
goto out_cancel;
}
/* finish deferred items on final commit */
if (!regrant && tp->t_dfops) {
- error = xfs_defer_finish(&tp, tp->t_dfops);
+ error = xfs_defer_finish(&tp);
if (error) {
- xfs_defer_cancel(tp->t_dfops);
+ xfs_defer_cancel(tp);
goto out_unreserve;
}
}
trace_xfs_trans_cancel(tp, _RET_IP_);
if (tp->t_dfops)
- xfs_defer_cancel(tp->t_dfops);
+ xfs_defer_cancel(tp);
/*
* See if the caller is relying on us to shut down the
tres.tr_logflags = XFS_TRANS_PERM_LOG_RES;
return xfs_trans_reserve(*tpp, &tres, 0, 0);
}
+
+void
+xfs_defer_cancel(
+ struct xfs_trans *tp)
+{
+ __xfs_defer_cancel(tp->t_dfops);
+}
flags, bpp, ops);
}
+/* cancel dfops associated with a transaction */
+void xfs_defer_cancel(struct xfs_trans *);
+
struct xfs_buf *xfs_trans_getsb(xfs_trans_t *, struct xfs_mount *, int);
void xfs_trans_brelse(xfs_trans_t *, struct xfs_buf *);