aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/quota/xfs_trans_dquot.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2005-06-21 01:48:47 -0400
committerNathan Scott <nathans@sgi.com>2005-06-21 01:48:47 -0400
commit06d10dd9ca70ff1318ff2b871ff5f61a94223d9f (patch)
tree5ce06a8dc60a7ee78183e5b97a3565ac10424ea1 /fs/xfs/quota/xfs_trans_dquot.c
parent77bc5beb5977a166e41b87c9d55d8e9cf2b3a04f (diff)
[XFS] Merge fixes into realtime quota code, since one/two reported, still
not enabled though. SGI-PV: 938145 SGI-Modid: xfs-linux:xfs-kern:22900a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/quota/xfs_trans_dquot.c')
-rw-r--r--fs/xfs/quota/xfs_trans_dquot.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/fs/xfs/quota/xfs_trans_dquot.c b/fs/xfs/quota/xfs_trans_dquot.c
index 565efb73c233..3b99daf8a640 100644
--- a/fs/xfs/quota/xfs_trans_dquot.c
+++ b/fs/xfs/quota/xfs_trans_dquot.c
@@ -497,7 +497,7 @@ xfs_trans_apply_dquot_deltas(
497 * Adjust the RT reservation. 497 * Adjust the RT reservation.
498 */ 498 */
499 if (qtrx->qt_rtblk_res != 0) { 499 if (qtrx->qt_rtblk_res != 0) {
500 if (qtrx->qt_blk_res != qtrx->qt_blk_res_used) { 500 if (qtrx->qt_rtblk_res != qtrx->qt_rtblk_res_used) {
501 if (qtrx->qt_rtblk_res > 501 if (qtrx->qt_rtblk_res >
502 qtrx->qt_rtblk_res_used) 502 qtrx->qt_rtblk_res_used)
503 dqp->q_res_rtbcount -= (xfs_qcnt_t) 503 dqp->q_res_rtbcount -= (xfs_qcnt_t)
@@ -530,12 +530,6 @@ xfs_trans_apply_dquot_deltas(
530 (xfs_qcnt_t)qtrx->qt_icount_delta; 530 (xfs_qcnt_t)qtrx->qt_icount_delta;
531 } 531 }
532 532
533
534#ifdef QUOTADEBUG
535 if (qtrx->qt_rtblk_res != 0)
536 cmn_err(CE_DEBUG, "RT res %d for 0x%p\n",
537 (int) qtrx->qt_rtblk_res, dqp);
538#endif
539 ASSERT(dqp->q_res_bcount >= 533 ASSERT(dqp->q_res_bcount >=
540 INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT)); 534 INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT));
541 ASSERT(dqp->q_res_icount >= 535 ASSERT(dqp->q_res_icount >=
@@ -636,7 +630,10 @@ xfs_trans_dqresv(
636 int error; 630 int error;
637 xfs_qcnt_t hardlimit; 631 xfs_qcnt_t hardlimit;
638 xfs_qcnt_t softlimit; 632 xfs_qcnt_t softlimit;
639 time_t btimer; 633 time_t timer;
634 xfs_qwarncnt_t warns;
635 xfs_qwarncnt_t warnlimit;
636 xfs_qcnt_t count;
640 xfs_qcnt_t *resbcountp; 637 xfs_qcnt_t *resbcountp;
641 xfs_quotainfo_t *q = mp->m_quotainfo; 638 xfs_quotainfo_t *q = mp->m_quotainfo;
642 639
@@ -651,7 +648,9 @@ xfs_trans_dqresv(
651 softlimit = INT_GET(dqp->q_core.d_blk_softlimit, ARCH_CONVERT); 648 softlimit = INT_GET(dqp->q_core.d_blk_softlimit, ARCH_CONVERT);
652 if (!softlimit) 649 if (!softlimit)
653 softlimit = q->qi_bsoftlimit; 650 softlimit = q->qi_bsoftlimit;
654 btimer = INT_GET(dqp->q_core.d_btimer, ARCH_CONVERT); 651 timer = INT_GET(dqp->q_core.d_btimer, ARCH_CONVERT);
652 warns = INT_GET(dqp->q_core.d_bwarns, ARCH_CONVERT);
653 warnlimit = XFS_QI_BWARNLIMIT(dqp->q_mount);
655 resbcountp = &dqp->q_res_bcount; 654 resbcountp = &dqp->q_res_bcount;
656 } else { 655 } else {
657 ASSERT(flags & XFS_TRANS_DQ_RES_RTBLKS); 656 ASSERT(flags & XFS_TRANS_DQ_RES_RTBLKS);
@@ -661,7 +660,9 @@ xfs_trans_dqresv(
661 softlimit = INT_GET(dqp->q_core.d_rtb_softlimit, ARCH_CONVERT); 660 softlimit = INT_GET(dqp->q_core.d_rtb_softlimit, ARCH_CONVERT);
662 if (!softlimit) 661 if (!softlimit)
663 softlimit = q->qi_rtbsoftlimit; 662 softlimit = q->qi_rtbsoftlimit;
664 btimer = INT_GET(dqp->q_core.d_rtbtimer, ARCH_CONVERT); 663 timer = INT_GET(dqp->q_core.d_rtbtimer, ARCH_CONVERT);
664 warns = INT_GET(dqp->q_core.d_rtbwarns, ARCH_CONVERT);
665 warnlimit = XFS_QI_RTBWARNLIMIT(dqp->q_mount);
665 resbcountp = &dqp->q_res_rtbcount; 666 resbcountp = &dqp->q_res_rtbcount;
666 } 667 }
667 error = 0; 668 error = 0;
@@ -691,37 +692,36 @@ xfs_trans_dqresv(
691 * If timer or warnings has expired, 692 * If timer or warnings has expired,
692 * return EDQUOT 693 * return EDQUOT
693 */ 694 */
694 if ((btimer != 0 && get_seconds() > btimer) || 695 if ((timer != 0 && get_seconds() > timer) ||
695 (dqp->q_core.d_bwarns && 696 (warns != 0 && warns >= warnlimit)) {
696 INT_GET(dqp->q_core.d_bwarns, ARCH_CONVERT) >=
697 XFS_QI_BWARNLIMIT(dqp->q_mount))) {
698 error = EDQUOT; 697 error = EDQUOT;
699 goto error_return; 698 goto error_return;
700 } 699 }
701 } 700 }
702 } 701 }
703 if (ninos > 0) { 702 if (ninos > 0) {
704 hardlimit = INT_GET(dqp->q_core.d_ino_hardlimit, ARCH_CONVERT); 703 count = INT_GET(dqp->q_core.d_icount, ARCH_CONVERT);
704 timer = INT_GET(dqp->q_core.d_itimer, ARCH_CONVERT);
705 warns = INT_GET(dqp->q_core.d_iwarns, ARCH_CONVERT);
706 warnlimit = XFS_QI_IWARNLIMIT(dqp->q_mount);
707 hardlimit = INT_GET(dqp->q_core.d_ino_hardlimit,
708 ARCH_CONVERT);
705 if (!hardlimit) 709 if (!hardlimit)
706 hardlimit = q->qi_ihardlimit; 710 hardlimit = q->qi_ihardlimit;
707 softlimit = INT_GET(dqp->q_core.d_ino_softlimit, ARCH_CONVERT); 711 softlimit = INT_GET(dqp->q_core.d_ino_softlimit,
712 ARCH_CONVERT);
708 if (!softlimit) 713 if (!softlimit)
709 softlimit = q->qi_isoftlimit; 714 softlimit = q->qi_isoftlimit;
710 if (hardlimit > 0ULL && 715 if (hardlimit > 0ULL && count >= hardlimit) {
711 INT_GET(dqp->q_core.d_icount, ARCH_CONVERT) >= hardlimit) {
712 error = EDQUOT; 716 error = EDQUOT;
713 goto error_return; 717 goto error_return;
714 } else if (softlimit > 0ULL && 718 } else if (softlimit > 0ULL && count >= softlimit) {
715 INT_GET(dqp->q_core.d_icount, ARCH_CONVERT) >= softlimit) {
716 /* 719 /*
717 * If timer or warnings has expired, 720 * If timer or warnings has expired,
718 * return EDQUOT 721 * return EDQUOT
719 */ 722 */
720 if ((dqp->q_core.d_itimer && 723 if ((timer != 0 && get_seconds() > timer) ||
721 get_seconds() > INT_GET(dqp->q_core.d_itimer, ARCH_CONVERT)) || 724 (warns != 0 && warns >= warnlimit)) {
722 (dqp->q_core.d_iwarns &&
723 INT_GET(dqp->q_core.d_iwarns, ARCH_CONVERT) >=
724 XFS_QI_IWARNLIMIT(dqp->q_mount))) {
725 error = EDQUOT; 725 error = EDQUOT;
726 goto error_return; 726 goto error_return;
727 } 727 }