100 xfs_dqtrx_t *oqa, *nqa;
106 oqa = otp->t_dqinfo->dqa_usrdquots;
107 nqa = ntp->t_dqinfo->dqa_usrdquots;
116 for (j = 0; j < 2; j++) {
118 if (oqa[i].qt_dquot ==
NULL)
123 nq->qt_dquot = oq->qt_dquot;
124 nq->qt_bcount_delta = nq->qt_icount_delta = 0;
125 nq->qt_rtbcount_delta = 0;
130 nq->qt_blk_res = oq->qt_blk_res - oq->qt_blk_res_used;
131 oq->qt_blk_res = oq->qt_blk_res_used;
133 nq->qt_rtblk_res = oq->qt_rtblk_res -
134 oq->qt_rtblk_res_used;
135 oq->qt_rtblk_res = oq->qt_rtblk_res_used;
137 nq->qt_ino_res = oq->qt_ino_res - oq->qt_ino_res_used;
138 oq->qt_ino_res = oq->qt_ino_res_used;
141 oqa = otp->t_dqinfo->dqa_grpdquots;
142 nqa = ntp->t_dqinfo->dqa_grpdquots;
156 xfs_mount_t *
mp = tp->t_mountp;
160 ip->i_ino == mp->m_sb.sb_uquotino ||
161 ip->i_ino == mp->m_sb.sb_gquotino)
164 if (tp->t_dqinfo ==
NULL)
182 tp->t_dqinfo->dqa_usrdquots : tp->t_dqinfo->dqa_grpdquots;
185 if (qa[i].qt_dquot ==
NULL ||
186 qa[i].qt_dquot == dqp)
212 if (tp->t_dqinfo ==
NULL)
220 if (qtrx->qt_dquot ==
NULL)
221 qtrx->qt_dquot = dqp;
229 qtrx->qt_blk_res += (
ulong)delta;
236 qtrx->qt_ino_res += (
ulong)delta;
243 if (qtrx->qt_blk_res && delta > 0) {
244 qtrx->qt_blk_res_used += (
ulong)delta;
245 ASSERT(qtrx->qt_blk_res >= qtrx->qt_blk_res_used);
247 qtrx->qt_bcount_delta +=
delta;
251 qtrx->qt_delbcnt_delta +=
delta;
258 if (qtrx->qt_ino_res && delta > 0) {
259 qtrx->qt_ino_res_used += (
ulong)delta;
260 ASSERT(qtrx->qt_ino_res >= qtrx->qt_ino_res_used);
262 qtrx->qt_icount_delta +=
delta;
269 qtrx->qt_rtblk_res += (
ulong)delta;
276 if (qtrx->qt_rtblk_res && delta > 0) {
277 qtrx->qt_rtblk_res_used += (
ulong)delta;
278 ASSERT(qtrx->qt_rtblk_res >= qtrx->qt_rtblk_res_used);
280 qtrx->qt_rtbcount_delta +=
delta;
284 qtrx->qt_delrtb_delta +=
delta;
307 if (q[1].qt_dquot ==
NULL) {
308 xfs_dqlock(q[0].qt_dquot);
333 xfs_dqtrx_t *qtrx, *qa;
342 qa = tp->t_dqinfo->dqa_usrdquots;
343 for (j = 0; j < 2; j++) {
344 if (qa[0].qt_dquot ==
NULL) {
345 qa = tp->t_dqinfo->dqa_grpdquots;
360 if ((dqp = qtrx->qt_dquot) ==
NULL)
384 totalbdelta = qtrx->qt_bcount_delta +
385 qtrx->qt_delbcnt_delta;
386 totalrtbdelta = qtrx->qt_rtbcount_delta +
387 qtrx->qt_delrtb_delta;
393 if (totalrtbdelta < 0)
397 if (qtrx->qt_icount_delta < 0)
399 -qtrx->qt_icount_delta);
404 if (qtrx->qt_icount_delta)
429 if (qtrx->qt_blk_res != 0) {
430 if (qtrx->qt_blk_res != qtrx->qt_blk_res_used) {
431 if (qtrx->qt_blk_res >
432 qtrx->qt_blk_res_used)
435 qtrx->qt_blk_res_used);
438 (qtrx->qt_blk_res_used -
449 if (qtrx->qt_bcount_delta) {
457 if (qtrx->qt_rtblk_res != 0) {
458 if (qtrx->qt_rtblk_res != qtrx->qt_rtblk_res_used) {
459 if (qtrx->qt_rtblk_res >
460 qtrx->qt_rtblk_res_used)
462 (qtrx->qt_rtblk_res -
463 qtrx->qt_rtblk_res_used);
466 (qtrx->qt_rtblk_res_used -
470 if (qtrx->qt_rtbcount_delta)
478 if (qtrx->qt_ino_res != 0) {
479 ASSERT(qtrx->qt_ino_res >=
480 qtrx->qt_ino_res_used);
481 if (qtrx->qt_ino_res > qtrx->qt_ino_res_used)
484 qtrx->qt_ino_res_used);
486 if (qtrx->qt_icount_delta)
501 qa = tp->t_dqinfo->dqa_grpdquots;
518 xfs_dqtrx_t *qtrx, *qa;
524 qa = tp->t_dqinfo->dqa_usrdquots;
526 for (j = 0; j < 2; j++) {
533 if ((dqp = qtrx->qt_dquot) ==
NULL)
541 if (qtrx->qt_blk_res) {
547 if (qtrx->qt_ino_res) {
556 if (qtrx->qt_rtblk_res) {
568 qa = tp->t_dqinfo->dqa_grpdquots;
574 struct xfs_mount *
mp,
585 mp->m_super->s_dev, type);
624 warnlimit = dqp->
q_mount->m_quotainfo->qi_bwarnlimit;
636 warnlimit = dqp->
q_mount->m_quotainfo->qi_rtbwarnlimit;
651 total_count = *resbcountp + nblks;
652 if (hardlimit && total_count > hardlimit) {
656 if (softlimit && total_count > softlimit) {
658 (warns != 0 && warns >= warnlimit)) {
671 warnlimit = dqp->
q_mount->m_quotainfo->qi_iwarnlimit;
679 if (hardlimit && total_count > hardlimit) {
683 if (softlimit && total_count > softlimit) {
685 (warns != 0 && warns >= warnlimit)) {
715 flags & XFS_QMOPT_RESBLK_MASK,
764 if (tp && tp->t_dqinfo ==
NULL)
786 -nblks, -ninos, flags);
806 struct xfs_trans *tp,
807 struct xfs_inode *
ip,
812 struct xfs_mount *
mp = ip->i_mount;
819 ASSERT(ip->i_ino != mp->m_sb.sb_uquotino);
820 ASSERT(ip->i_ino != mp->m_sb.sb_gquotino);
822 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
832 ip->i_udquot, ip->i_gdquot,
833 nblks, ninos, flags);