Lines Matching refs:dfc
701 struct xfs_defer_capture *dfc; in xfs_defer_ops_capture() local
713 dfc = kmem_zalloc(sizeof(*dfc), KM_NOFS); in xfs_defer_ops_capture()
714 INIT_LIST_HEAD(&dfc->dfc_list); in xfs_defer_ops_capture()
715 INIT_LIST_HEAD(&dfc->dfc_dfops); in xfs_defer_ops_capture()
718 list_splice_init(&tp->t_dfops, &dfc->dfc_dfops); in xfs_defer_ops_capture()
719 dfc->dfc_tpflags = tp->t_flags & XFS_TRANS_LOWMODE; in xfs_defer_ops_capture()
723 dfc->dfc_blkres = tp->t_blk_res - tp->t_blk_res_used; in xfs_defer_ops_capture()
724 dfc->dfc_rtxres = tp->t_rtx_res - tp->t_rtx_res_used; in xfs_defer_ops_capture()
727 dfc->dfc_logres = tp->t_log_res; in xfs_defer_ops_capture()
729 error = xfs_defer_save_resources(&dfc->dfc_held, tp); in xfs_defer_ops_capture()
744 for (i = 0; i < dfc->dfc_held.dr_inos; i++) { in xfs_defer_ops_capture()
745 ASSERT(xfs_isilocked(dfc->dfc_held.dr_ip[i], XFS_ILOCK_EXCL)); in xfs_defer_ops_capture()
746 ihold(VFS_I(dfc->dfc_held.dr_ip[i])); in xfs_defer_ops_capture()
749 for (i = 0; i < dfc->dfc_held.dr_bufs; i++) in xfs_defer_ops_capture()
750 xfs_buf_hold(dfc->dfc_held.dr_bp[i]); in xfs_defer_ops_capture()
752 return dfc; in xfs_defer_ops_capture()
759 struct xfs_defer_capture *dfc) in xfs_defer_ops_capture_free() argument
763 xfs_defer_cancel_list(mp, &dfc->dfc_dfops); in xfs_defer_ops_capture_free()
765 for (i = 0; i < dfc->dfc_held.dr_bufs; i++) in xfs_defer_ops_capture_free()
766 xfs_buf_relse(dfc->dfc_held.dr_bp[i]); in xfs_defer_ops_capture_free()
768 for (i = 0; i < dfc->dfc_held.dr_inos; i++) in xfs_defer_ops_capture_free()
769 xfs_irele(dfc->dfc_held.dr_ip[i]); in xfs_defer_ops_capture_free()
771 kmem_free(dfc); in xfs_defer_ops_capture_free()
788 struct xfs_defer_capture *dfc; in xfs_defer_ops_capture_and_commit() local
792 dfc = xfs_defer_ops_capture(tp); in xfs_defer_ops_capture_and_commit()
793 if (IS_ERR(dfc)) { in xfs_defer_ops_capture_and_commit()
795 return PTR_ERR(dfc); in xfs_defer_ops_capture_and_commit()
797 if (!dfc) in xfs_defer_ops_capture_and_commit()
803 xfs_defer_ops_capture_free(mp, dfc); in xfs_defer_ops_capture_and_commit()
807 list_add_tail(&dfc->dfc_list, capture_list); in xfs_defer_ops_capture_and_commit()
819 struct xfs_defer_capture *dfc, in xfs_defer_ops_continue() argument
829 if (dfc->dfc_held.dr_inos == 2) in xfs_defer_ops_continue()
830 xfs_lock_two_inodes(dfc->dfc_held.dr_ip[0], XFS_ILOCK_EXCL, in xfs_defer_ops_continue()
831 dfc->dfc_held.dr_ip[1], XFS_ILOCK_EXCL); in xfs_defer_ops_continue()
832 else if (dfc->dfc_held.dr_inos == 1) in xfs_defer_ops_continue()
833 xfs_ilock(dfc->dfc_held.dr_ip[0], XFS_ILOCK_EXCL); in xfs_defer_ops_continue()
835 for (i = 0; i < dfc->dfc_held.dr_bufs; i++) in xfs_defer_ops_continue()
836 xfs_buf_lock(dfc->dfc_held.dr_bp[i]); in xfs_defer_ops_continue()
839 xfs_defer_restore_resources(tp, &dfc->dfc_held); in xfs_defer_ops_continue()
840 memcpy(dres, &dfc->dfc_held, sizeof(struct xfs_defer_resources)); in xfs_defer_ops_continue()
844 list_splice_init(&dfc->dfc_dfops, &tp->t_dfops); in xfs_defer_ops_continue()
845 tp->t_flags |= dfc->dfc_tpflags; in xfs_defer_ops_continue()
847 kmem_free(dfc); in xfs_defer_ops_continue()