diff options
Diffstat (limited to 'fs/xfs/quota/xfs_trans_dquot.c')
-rw-r--r-- | fs/xfs/quota/xfs_trans_dquot.c | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/fs/xfs/quota/xfs_trans_dquot.c b/fs/xfs/quota/xfs_trans_dquot.c index e94bed4e1081..3290975d31f7 100644 --- a/fs/xfs/quota/xfs_trans_dquot.c +++ b/fs/xfs/quota/xfs_trans_dquot.c | |||
@@ -413,25 +413,25 @@ xfs_trans_apply_dquot_deltas( | |||
413 | qtrx->qt_delrtb_delta; | 413 | qtrx->qt_delrtb_delta; |
414 | #ifdef QUOTADEBUG | 414 | #ifdef QUOTADEBUG |
415 | if (totalbdelta < 0) | 415 | if (totalbdelta < 0) |
416 | ASSERT(INT_GET(d->d_bcount, ARCH_CONVERT) >= | 416 | ASSERT(be64_to_cpu(d->d_bcount) >= |
417 | (xfs_qcnt_t) -totalbdelta); | 417 | (xfs_qcnt_t) -totalbdelta); |
418 | 418 | ||
419 | if (totalrtbdelta < 0) | 419 | if (totalrtbdelta < 0) |
420 | ASSERT(INT_GET(d->d_rtbcount, ARCH_CONVERT) >= | 420 | ASSERT(be64_to_cpu(d->d_rtbcount) >= |
421 | (xfs_qcnt_t) -totalrtbdelta); | 421 | (xfs_qcnt_t) -totalrtbdelta); |
422 | 422 | ||
423 | if (qtrx->qt_icount_delta < 0) | 423 | if (qtrx->qt_icount_delta < 0) |
424 | ASSERT(INT_GET(d->d_icount, ARCH_CONVERT) >= | 424 | ASSERT(be64_to_cpu(d->d_icount) >= |
425 | (xfs_qcnt_t) -qtrx->qt_icount_delta); | 425 | (xfs_qcnt_t) -qtrx->qt_icount_delta); |
426 | #endif | 426 | #endif |
427 | if (totalbdelta) | 427 | if (totalbdelta) |
428 | INT_MOD(d->d_bcount, ARCH_CONVERT, (xfs_qcnt_t)totalbdelta); | 428 | be64_add(&d->d_bcount, (xfs_qcnt_t)totalbdelta); |
429 | 429 | ||
430 | if (qtrx->qt_icount_delta) | 430 | if (qtrx->qt_icount_delta) |
431 | INT_MOD(d->d_icount, ARCH_CONVERT, (xfs_qcnt_t)qtrx->qt_icount_delta); | 431 | be64_add(&d->d_icount, (xfs_qcnt_t)qtrx->qt_icount_delta); |
432 | 432 | ||
433 | if (totalrtbdelta) | 433 | if (totalrtbdelta) |
434 | INT_MOD(d->d_rtbcount, ARCH_CONVERT, (xfs_qcnt_t)totalrtbdelta); | 434 | be64_add(&d->d_rtbcount, (xfs_qcnt_t)totalrtbdelta); |
435 | 435 | ||
436 | /* | 436 | /* |
437 | * Get any default limits in use. | 437 | * Get any default limits in use. |
@@ -515,11 +515,11 @@ xfs_trans_apply_dquot_deltas( | |||
515 | } | 515 | } |
516 | 516 | ||
517 | ASSERT(dqp->q_res_bcount >= | 517 | ASSERT(dqp->q_res_bcount >= |
518 | INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT)); | 518 | be64_to_cpu(dqp->q_core.d_bcount)); |
519 | ASSERT(dqp->q_res_icount >= | 519 | ASSERT(dqp->q_res_icount >= |
520 | INT_GET(dqp->q_core.d_icount, ARCH_CONVERT)); | 520 | be64_to_cpu(dqp->q_core.d_icount)); |
521 | ASSERT(dqp->q_res_rtbcount >= | 521 | ASSERT(dqp->q_res_rtbcount >= |
522 | INT_GET(dqp->q_core.d_rtbcount, ARCH_CONVERT)); | 522 | be64_to_cpu(dqp->q_core.d_rtbcount)); |
523 | } | 523 | } |
524 | /* | 524 | /* |
525 | * Do the group quotas next | 525 | * Do the group quotas next |
@@ -626,26 +626,26 @@ xfs_trans_dqresv( | |||
626 | } | 626 | } |
627 | ASSERT(XFS_DQ_IS_LOCKED(dqp)); | 627 | ASSERT(XFS_DQ_IS_LOCKED(dqp)); |
628 | if (flags & XFS_TRANS_DQ_RES_BLKS) { | 628 | if (flags & XFS_TRANS_DQ_RES_BLKS) { |
629 | hardlimit = INT_GET(dqp->q_core.d_blk_hardlimit, ARCH_CONVERT); | 629 | hardlimit = be64_to_cpu(dqp->q_core.d_blk_hardlimit); |
630 | if (!hardlimit) | 630 | if (!hardlimit) |
631 | hardlimit = q->qi_bhardlimit; | 631 | hardlimit = q->qi_bhardlimit; |
632 | softlimit = INT_GET(dqp->q_core.d_blk_softlimit, ARCH_CONVERT); | 632 | softlimit = be64_to_cpu(dqp->q_core.d_blk_softlimit); |
633 | if (!softlimit) | 633 | if (!softlimit) |
634 | softlimit = q->qi_bsoftlimit; | 634 | softlimit = q->qi_bsoftlimit; |
635 | timer = INT_GET(dqp->q_core.d_btimer, ARCH_CONVERT); | 635 | timer = be32_to_cpu(dqp->q_core.d_btimer); |
636 | warns = INT_GET(dqp->q_core.d_bwarns, ARCH_CONVERT); | 636 | warns = be16_to_cpu(dqp->q_core.d_bwarns); |
637 | warnlimit = XFS_QI_BWARNLIMIT(dqp->q_mount); | 637 | warnlimit = XFS_QI_BWARNLIMIT(dqp->q_mount); |
638 | resbcountp = &dqp->q_res_bcount; | 638 | resbcountp = &dqp->q_res_bcount; |
639 | } else { | 639 | } else { |
640 | ASSERT(flags & XFS_TRANS_DQ_RES_RTBLKS); | 640 | ASSERT(flags & XFS_TRANS_DQ_RES_RTBLKS); |
641 | hardlimit = INT_GET(dqp->q_core.d_rtb_hardlimit, ARCH_CONVERT); | 641 | hardlimit = be64_to_cpu(dqp->q_core.d_rtb_hardlimit); |
642 | if (!hardlimit) | 642 | if (!hardlimit) |
643 | hardlimit = q->qi_rtbhardlimit; | 643 | hardlimit = q->qi_rtbhardlimit; |
644 | softlimit = INT_GET(dqp->q_core.d_rtb_softlimit, ARCH_CONVERT); | 644 | softlimit = be64_to_cpu(dqp->q_core.d_rtb_softlimit); |
645 | if (!softlimit) | 645 | if (!softlimit) |
646 | softlimit = q->qi_rtbsoftlimit; | 646 | softlimit = q->qi_rtbsoftlimit; |
647 | timer = INT_GET(dqp->q_core.d_rtbtimer, ARCH_CONVERT); | 647 | timer = be32_to_cpu(dqp->q_core.d_rtbtimer); |
648 | warns = INT_GET(dqp->q_core.d_rtbwarns, ARCH_CONVERT); | 648 | warns = be16_to_cpu(dqp->q_core.d_rtbwarns); |
649 | warnlimit = XFS_QI_RTBWARNLIMIT(dqp->q_mount); | 649 | warnlimit = XFS_QI_RTBWARNLIMIT(dqp->q_mount); |
650 | resbcountp = &dqp->q_res_rtbcount; | 650 | resbcountp = &dqp->q_res_rtbcount; |
651 | } | 651 | } |
@@ -684,16 +684,14 @@ xfs_trans_dqresv( | |||
684 | } | 684 | } |
685 | } | 685 | } |
686 | if (ninos > 0) { | 686 | if (ninos > 0) { |
687 | count = INT_GET(dqp->q_core.d_icount, ARCH_CONVERT); | 687 | count = be64_to_cpu(dqp->q_core.d_icount); |
688 | timer = INT_GET(dqp->q_core.d_itimer, ARCH_CONVERT); | 688 | timer = be32_to_cpu(dqp->q_core.d_itimer); |
689 | warns = INT_GET(dqp->q_core.d_iwarns, ARCH_CONVERT); | 689 | warns = be16_to_cpu(dqp->q_core.d_iwarns); |
690 | warnlimit = XFS_QI_IWARNLIMIT(dqp->q_mount); | 690 | warnlimit = XFS_QI_IWARNLIMIT(dqp->q_mount); |
691 | hardlimit = INT_GET(dqp->q_core.d_ino_hardlimit, | 691 | hardlimit = be64_to_cpu(dqp->q_core.d_ino_hardlimit); |
692 | ARCH_CONVERT); | ||
693 | if (!hardlimit) | 692 | if (!hardlimit) |
694 | hardlimit = q->qi_ihardlimit; | 693 | hardlimit = q->qi_ihardlimit; |
695 | softlimit = INT_GET(dqp->q_core.d_ino_softlimit, | 694 | softlimit = be64_to_cpu(dqp->q_core.d_ino_softlimit); |
696 | ARCH_CONVERT); | ||
697 | if (!softlimit) | 695 | if (!softlimit) |
698 | softlimit = q->qi_isoftlimit; | 696 | softlimit = q->qi_isoftlimit; |
699 | if (hardlimit > 0ULL && count >= hardlimit) { | 697 | if (hardlimit > 0ULL && count >= hardlimit) { |
@@ -740,9 +738,9 @@ xfs_trans_dqresv( | |||
740 | XFS_TRANS_DQ_RES_INOS, | 738 | XFS_TRANS_DQ_RES_INOS, |
741 | ninos); | 739 | ninos); |
742 | } | 740 | } |
743 | ASSERT(dqp->q_res_bcount >= INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT)); | 741 | ASSERT(dqp->q_res_bcount >= be64_to_cpu(dqp->q_core.d_bcount)); |
744 | ASSERT(dqp->q_res_rtbcount >= INT_GET(dqp->q_core.d_rtbcount, ARCH_CONVERT)); | 742 | ASSERT(dqp->q_res_rtbcount >= be64_to_cpu(dqp->q_core.d_rtbcount)); |
745 | ASSERT(dqp->q_res_icount >= INT_GET(dqp->q_core.d_icount, ARCH_CONVERT)); | 743 | ASSERT(dqp->q_res_icount >= be64_to_cpu(dqp->q_core.d_icount)); |
746 | 744 | ||
747 | error_return: | 745 | error_return: |
748 | if (! (flags & XFS_QMOPT_DQLOCK)) { | 746 | if (! (flags & XFS_QMOPT_DQLOCK)) { |