Lines Matching refs:dqp

32 	struct xfs_dquot	*dqp)  in xfs_trans_dqjoin()  argument
34 ASSERT(XFS_DQ_IS_LOCKED(dqp)); in xfs_trans_dqjoin()
35 ASSERT(dqp->q_logitem.qli_dquot == dqp); in xfs_trans_dqjoin()
40 xfs_trans_add_item(tp, &dqp->q_logitem.qli_item); in xfs_trans_dqjoin()
56 struct xfs_dquot *dqp) in xfs_trans_log_dquot() argument
58 ASSERT(XFS_DQ_IS_LOCKED(dqp)); in xfs_trans_log_dquot()
61 if (dqp->q_id != 0 && in xfs_trans_log_dquot()
63 !(dqp->q_type & XFS_DQTYPE_BIGTIME)) in xfs_trans_log_dquot()
64 dqp->q_type |= XFS_DQTYPE_BIGTIME; in xfs_trans_log_dquot()
67 set_bit(XFS_LI_DIRTY, &dqp->q_logitem.qli_item.li_flags); in xfs_trans_log_dquot()
155 struct xfs_dquot *dqp, in xfs_trans_mod_ino_dquot() argument
159 xfs_trans_mod_dquot(tp, dqp, field, delta); in xfs_trans_mod_ino_dquot()
165 .q_type = xfs_dquot_type(dqp), in xfs_trans_mod_ino_dquot()
166 .q_id = dqp->q_id, in xfs_trans_mod_ino_dquot()
261 struct xfs_dquot *dqp) in xfs_trans_get_dqtrx() argument
266 switch (xfs_dquot_type(dqp)) { in xfs_trans_get_dqtrx()
282 qa[i].qt_dquot == dqp) in xfs_trans_get_dqtrx()
298 struct xfs_dquot *dqp, in xfs_trans_mod_dquot() argument
317 qtrx = xfs_trans_get_dqtrx(tp, dqp); in xfs_trans_mod_dquot()
320 qtrx->qt_dquot = dqp; in xfs_trans_mod_dquot()
323 trace_xfs_trans_mod_dquot(tp, dqp, field, delta); in xfs_trans_mod_dquot()
445 struct xfs_dquot *dqp) in xfs_trans_apply_dquot_deltas_hook() argument
450 .q_type = xfs_dquot_type(dqp), in xfs_trans_apply_dquot_deltas_hook()
451 .q_id = dqp->q_id, in xfs_trans_apply_dquot_deltas_hook()
460 # define xfs_trans_apply_dquot_deltas_hook(tp, dqp) ((void)0) argument
476 struct xfs_dquot *dqp; in xfs_trans_apply_dquot_deltas() local
503 if ((dqp = qtrx->qt_dquot) == NULL) in xfs_trans_apply_dquot_deltas()
506 ASSERT(XFS_DQ_IS_LOCKED(dqp)); in xfs_trans_apply_dquot_deltas()
508 xfs_trans_apply_dquot_deltas_hook(tp, dqp); in xfs_trans_apply_dquot_deltas()
534 trace_xfs_trans_apply_dquot_deltas_before(dqp); in xfs_trans_apply_dquot_deltas()
540 ASSERT(dqp->q_blk.count >= -totalbdelta); in xfs_trans_apply_dquot_deltas()
543 ASSERT(dqp->q_rtb.count >= -totalrtbdelta); in xfs_trans_apply_dquot_deltas()
546 ASSERT(dqp->q_ino.count >= -qtrx->qt_icount_delta); in xfs_trans_apply_dquot_deltas()
549 dqp->q_blk.count += totalbdelta; in xfs_trans_apply_dquot_deltas()
552 dqp->q_ino.count += qtrx->qt_icount_delta; in xfs_trans_apply_dquot_deltas()
555 dqp->q_rtb.count += totalrtbdelta; in xfs_trans_apply_dquot_deltas()
559 trace_xfs_trans_apply_dquot_deltas_after(dqp); in xfs_trans_apply_dquot_deltas()
565 if (dqp->q_id) { in xfs_trans_apply_dquot_deltas()
566 xfs_qm_adjust_dqlimits(dqp); in xfs_trans_apply_dquot_deltas()
567 xfs_qm_adjust_dqtimers(dqp); in xfs_trans_apply_dquot_deltas()
570 dqp->q_flags |= XFS_DQFLAG_DIRTY; in xfs_trans_apply_dquot_deltas()
574 xfs_trans_log_dquot(tp, dqp); in xfs_trans_apply_dquot_deltas()
581 xfs_apply_quota_reservation_deltas(&dqp->q_blk, in xfs_trans_apply_dquot_deltas()
588 xfs_apply_quota_reservation_deltas(&dqp->q_rtb, in xfs_trans_apply_dquot_deltas()
597 xfs_apply_quota_reservation_deltas(&dqp->q_ino, in xfs_trans_apply_dquot_deltas()
602 ASSERT(dqp->q_blk.reserved >= dqp->q_blk.count); in xfs_trans_apply_dquot_deltas()
603 ASSERT(dqp->q_ino.reserved >= dqp->q_ino.count); in xfs_trans_apply_dquot_deltas()
604 ASSERT(dqp->q_rtb.reserved >= dqp->q_rtb.count); in xfs_trans_apply_dquot_deltas()
614 struct xfs_dquot *dqp) in xfs_trans_unreserve_and_mod_dquots_hook() argument
619 .q_type = xfs_dquot_type(dqp), in xfs_trans_unreserve_and_mod_dquots_hook()
620 .q_id = dqp->q_id, in xfs_trans_unreserve_and_mod_dquots_hook()
629 # define xfs_trans_unreserve_and_mod_dquots_hook(tp, dqp) ((void)0) argument
644 struct xfs_dquot *dqp; in xfs_trans_unreserve_and_mod_dquots() local
660 if ((dqp = qtrx->qt_dquot) == NULL) in xfs_trans_unreserve_and_mod_dquots()
663 xfs_trans_unreserve_and_mod_dquots_hook(tp, dqp); in xfs_trans_unreserve_and_mod_dquots()
672 xfs_dqlock(dqp); in xfs_trans_unreserve_and_mod_dquots()
674 dqp->q_blk.reserved -= in xfs_trans_unreserve_and_mod_dquots()
679 xfs_dqlock(dqp); in xfs_trans_unreserve_and_mod_dquots()
682 dqp->q_ino.reserved -= in xfs_trans_unreserve_and_mod_dquots()
688 xfs_dqlock(dqp); in xfs_trans_unreserve_and_mod_dquots()
691 dqp->q_rtb.reserved -= in xfs_trans_unreserve_and_mod_dquots()
695 xfs_dqunlock(dqp); in xfs_trans_unreserve_and_mod_dquots()
704 struct xfs_dquot *dqp, in xfs_quota_warn() argument
709 switch (xfs_dquot_type(dqp)) { in xfs_quota_warn()
723 quota_send_warning(make_kqid(&init_user_ns, qtype, dqp->q_id), in xfs_quota_warn()
788 struct xfs_dquot *dqp, in xfs_trans_dqresv() argument
798 xfs_dqlock(dqp); in xfs_trans_dqresv()
800 defq = xfs_get_defquota(q, xfs_dquot_type(dqp)); in xfs_trans_dqresv()
803 blkres = &dqp->q_blk; in xfs_trans_dqresv()
806 blkres = &dqp->q_rtb; in xfs_trans_dqresv()
810 if ((flags & XFS_QMOPT_FORCE_RES) == 0 && dqp->q_id && in xfs_trans_dqresv()
811 xfs_dquot_is_enforced(dqp)) { in xfs_trans_dqresv()
825 xfs_quota_warn(mp, dqp, quota_nl + 3); in xfs_trans_dqresv()
830 quota_nl = xfs_dqresv_check(&dqp->q_ino, &defq->ino, ninos, in xfs_trans_dqresv()
833 xfs_quota_warn(mp, dqp, quota_nl); in xfs_trans_dqresv()
844 dqp->q_ino.reserved += (xfs_qcnt_t)ninos; in xfs_trans_dqresv()
855 xfs_trans_mod_dquot(tp, dqp, flags & XFS_QMOPT_RESBLK_MASK, in xfs_trans_dqresv()
857 xfs_trans_mod_dquot(tp, dqp, XFS_TRANS_DQ_RES_INOS, ninos); in xfs_trans_dqresv()
860 if (XFS_IS_CORRUPT(mp, dqp->q_blk.reserved < dqp->q_blk.count) || in xfs_trans_dqresv()
861 XFS_IS_CORRUPT(mp, dqp->q_rtb.reserved < dqp->q_rtb.count) || in xfs_trans_dqresv()
862 XFS_IS_CORRUPT(mp, dqp->q_ino.reserved < dqp->q_ino.count)) in xfs_trans_dqresv()
865 xfs_dqunlock(dqp); in xfs_trans_dqresv()
869 xfs_dqunlock(dqp); in xfs_trans_dqresv()
870 if (xfs_dquot_type(dqp) == XFS_DQTYPE_PROJ) in xfs_trans_dqresv()
874 xfs_dqunlock(dqp); in xfs_trans_dqresv()