Lines Matching refs:tp
201 struct xfs_trans *tp, in xfs_defer_create_intent() argument
211 lip = ops->create_intent(tp, &dfp->dfp_work, dfp->dfp_count, sort); in xfs_defer_create_intent()
231 struct xfs_trans *tp) in xfs_defer_create_intents() argument
236 list_for_each_entry(dfp, &tp->t_dfops, dfp_list) { in xfs_defer_create_intents()
239 trace_xfs_defer_create_intent(tp->t_mountp, dfp); in xfs_defer_create_intents()
240 ret2 = xfs_defer_create_intent(tp, dfp, true); in xfs_defer_create_intents()
270 struct xfs_trans *tp, in xfs_defer_trans_abort() argument
273 trace_xfs_defer_trans_abort(tp, _RET_IP_); in xfs_defer_trans_abort()
274 xfs_defer_pending_abort(tp->t_mountp, dop_pending); in xfs_defer_trans_abort()
284 struct xfs_trans *tp) in xfs_defer_save_resources() argument
292 list_for_each_entry(lip, &tp->t_items, li_trans) { in xfs_defer_save_resources()
306 xfs_trans_dirty_buf(tp, bli->bli_buf); in xfs_defer_save_resources()
318 xfs_trans_log_inode(tp, ili->ili_inode, in xfs_defer_save_resources()
334 struct xfs_trans *tp, in xfs_defer_restore_resources() argument
341 xfs_trans_ijoin(tp, dres->dr_ip[i], 0); in xfs_defer_restore_resources()
345 xfs_trans_bjoin(tp, dres->dr_bp[i]); in xfs_defer_restore_resources()
347 xfs_trans_ordered_buf(tp, dres->dr_bp[i]); in xfs_defer_restore_resources()
348 xfs_trans_bhold(tp, dres->dr_bp[i]); in xfs_defer_restore_resources()
473 struct xfs_trans *tp, in xfs_defer_finish_one() argument
481 trace_xfs_defer_pending_finish(tp->t_mountp, dfp); in xfs_defer_finish_one()
483 dfp->dfp_done = ops->create_done(tp, dfp->dfp_intent, dfp->dfp_count); in xfs_defer_finish_one()
487 trace_xfs_defer_finish_item(tp->t_mountp, dfp, li); in xfs_defer_finish_one()
488 error = ops->finish_item(tp, dfp->dfp_done, li, &state); in xfs_defer_finish_one()
502 ret = xfs_defer_create_intent(tp, dfp, false); in xfs_defer_finish_one()
516 ops->finish_cleanup(tp, state, error); in xfs_defer_finish_one()
530 struct xfs_trans **tp) in xfs_defer_finish_noroll() argument
536 ASSERT((*tp)->t_flags & XFS_TRANS_PERM_LOG_RES); in xfs_defer_finish_noroll()
538 trace_xfs_defer_finish(*tp, _RET_IP_); in xfs_defer_finish_noroll()
541 while (!list_empty(&dop_pending) || !list_empty(&(*tp)->t_dfops)) { in xfs_defer_finish_noroll()
551 int has_intents = xfs_defer_create_intents(*tp); in xfs_defer_finish_noroll()
553 list_splice_init(&(*tp)->t_dfops, &dop_pending); in xfs_defer_finish_noroll()
560 error = xfs_defer_trans_roll(tp); in xfs_defer_finish_noroll()
565 error = xfs_defer_relog(tp, &dop_pending); in xfs_defer_finish_noroll()
572 error = xfs_defer_finish_one(*tp, dfp); in xfs_defer_finish_noroll()
577 trace_xfs_defer_finish_done(*tp, _RET_IP_); in xfs_defer_finish_noroll()
581 xfs_defer_trans_abort(*tp, &dop_pending); in xfs_defer_finish_noroll()
582 xfs_force_shutdown((*tp)->t_mountp, SHUTDOWN_CORRUPT_INCORE); in xfs_defer_finish_noroll()
583 trace_xfs_defer_finish_error(*tp, error); in xfs_defer_finish_noroll()
584 xfs_defer_cancel_list((*tp)->t_mountp, &dop_pending); in xfs_defer_finish_noroll()
585 xfs_defer_cancel(*tp); in xfs_defer_finish_noroll()
591 struct xfs_trans **tp) in xfs_defer_finish() argument
599 error = xfs_defer_finish_noroll(tp); in xfs_defer_finish()
602 if ((*tp)->t_flags & XFS_TRANS_DIRTY) { in xfs_defer_finish()
603 error = xfs_defer_trans_roll(tp); in xfs_defer_finish()
605 xfs_force_shutdown((*tp)->t_mountp, in xfs_defer_finish()
612 ASSERT(list_empty(&(*tp)->t_dfops)); in xfs_defer_finish()
613 (*tp)->t_flags &= ~XFS_TRANS_LOWMODE; in xfs_defer_finish()
619 struct xfs_trans *tp) in xfs_defer_cancel() argument
621 struct xfs_mount *mp = tp->t_mountp; in xfs_defer_cancel()
623 trace_xfs_defer_cancel(tp, _RET_IP_); in xfs_defer_cancel()
624 xfs_defer_cancel_list(mp, &tp->t_dfops); in xfs_defer_cancel()
630 struct xfs_trans *tp, in xfs_defer_add() argument
637 ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES); in xfs_defer_add()
645 if (!list_empty(&tp->t_dfops)) { in xfs_defer_add()
646 dfp = list_last_entry(&tp->t_dfops, in xfs_defer_add()
660 list_add_tail(&dfp->dfp_list, &tp->t_dfops); in xfs_defer_add()
664 trace_xfs_defer_add_item(tp->t_mountp, dfp, li); in xfs_defer_add()
708 struct xfs_trans *tp) in xfs_defer_ops_capture() argument
714 if (list_empty(&tp->t_dfops)) in xfs_defer_ops_capture()
717 error = xfs_defer_create_intents(tp); in xfs_defer_ops_capture()
727 list_splice_init(&tp->t_dfops, &dfc->dfc_dfops); in xfs_defer_ops_capture()
728 dfc->dfc_tpflags = tp->t_flags & XFS_TRANS_LOWMODE; in xfs_defer_ops_capture()
729 tp->t_flags &= ~XFS_TRANS_LOWMODE; in xfs_defer_ops_capture()
732 dfc->dfc_blkres = tp->t_blk_res - tp->t_blk_res_used; in xfs_defer_ops_capture()
733 dfc->dfc_rtxres = tp->t_rtx_res - tp->t_rtx_res_used; in xfs_defer_ops_capture()
736 dfc->dfc_logres = tp->t_log_res; in xfs_defer_ops_capture()
738 error = xfs_defer_save_resources(&dfc->dfc_held, tp); in xfs_defer_ops_capture()
745 xfs_force_shutdown(tp->t_mountp, SHUTDOWN_CORRUPT_INCORE); in xfs_defer_ops_capture()
794 struct xfs_trans *tp, in xfs_defer_ops_capture_and_commit() argument
797 struct xfs_mount *mp = tp->t_mountp; in xfs_defer_ops_capture_and_commit()
802 dfc = xfs_defer_ops_capture(tp); in xfs_defer_ops_capture_and_commit()
804 xfs_trans_cancel(tp); in xfs_defer_ops_capture_and_commit()
808 return xfs_trans_commit(tp); in xfs_defer_ops_capture_and_commit()
811 error = xfs_trans_commit(tp); in xfs_defer_ops_capture_and_commit()
830 struct xfs_trans *tp, in xfs_defer_ops_continue() argument
835 ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES); in xfs_defer_ops_continue()
836 ASSERT(!(tp->t_flags & XFS_TRANS_DIRTY)); in xfs_defer_ops_continue()
849 xfs_defer_restore_resources(tp, &dfc->dfc_held); in xfs_defer_ops_continue()
854 list_splice_init(&dfc->dfc_dfops, &tp->t_dfops); in xfs_defer_ops_continue()
855 tp->t_flags |= dfc->dfc_tpflags; in xfs_defer_ops_continue()