diff options
Diffstat (limited to 'fs/xfs/xfs_qm_syscalls.c')
-rw-r--r-- | fs/xfs/xfs_qm_syscalls.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c index 5f53e75409b8..cf9a34051e07 100644 --- a/fs/xfs/xfs_qm_syscalls.c +++ b/fs/xfs/xfs_qm_syscalls.c | |||
@@ -408,10 +408,10 @@ xfs_qm_scall_getqstat( | |||
408 | { | 408 | { |
409 | struct xfs_quotainfo *q = mp->m_quotainfo; | 409 | struct xfs_quotainfo *q = mp->m_quotainfo; |
410 | struct xfs_inode *uip, *gip; | 410 | struct xfs_inode *uip, *gip; |
411 | boolean_t tempuqip, tempgqip; | 411 | bool tempuqip, tempgqip; |
412 | 412 | ||
413 | uip = gip = NULL; | 413 | uip = gip = NULL; |
414 | tempuqip = tempgqip = B_FALSE; | 414 | tempuqip = tempgqip = false; |
415 | memset(out, 0, sizeof(fs_quota_stat_t)); | 415 | memset(out, 0, sizeof(fs_quota_stat_t)); |
416 | 416 | ||
417 | out->qs_version = FS_QSTAT_VERSION; | 417 | out->qs_version = FS_QSTAT_VERSION; |
@@ -434,12 +434,12 @@ xfs_qm_scall_getqstat( | |||
434 | if (!uip && mp->m_sb.sb_uquotino != NULLFSINO) { | 434 | if (!uip && mp->m_sb.sb_uquotino != NULLFSINO) { |
435 | if (xfs_iget(mp, NULL, mp->m_sb.sb_uquotino, | 435 | if (xfs_iget(mp, NULL, mp->m_sb.sb_uquotino, |
436 | 0, 0, &uip) == 0) | 436 | 0, 0, &uip) == 0) |
437 | tempuqip = B_TRUE; | 437 | tempuqip = true; |
438 | } | 438 | } |
439 | if (!gip && mp->m_sb.sb_gquotino != NULLFSINO) { | 439 | if (!gip && mp->m_sb.sb_gquotino != NULLFSINO) { |
440 | if (xfs_iget(mp, NULL, mp->m_sb.sb_gquotino, | 440 | if (xfs_iget(mp, NULL, mp->m_sb.sb_gquotino, |
441 | 0, 0, &gip) == 0) | 441 | 0, 0, &gip) == 0) |
442 | tempgqip = B_TRUE; | 442 | tempgqip = true; |
443 | } | 443 | } |
444 | if (uip) { | 444 | if (uip) { |
445 | out->qs_uquota.qfs_nblks = uip->i_d.di_nblocks; | 445 | out->qs_uquota.qfs_nblks = uip->i_d.di_nblocks; |
@@ -490,8 +490,9 @@ xfs_qm_scall_setqlim( | |||
490 | return 0; | 490 | return 0; |
491 | 491 | ||
492 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SETQLIM); | 492 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SETQLIM); |
493 | if ((error = xfs_trans_reserve(tp, 0, sizeof(xfs_disk_dquot_t) + 128, | 493 | error = xfs_trans_reserve(tp, 0, XFS_QM_SETQLIM_LOG_RES(mp), |
494 | 0, 0, XFS_DEFAULT_LOG_COUNT))) { | 494 | 0, 0, XFS_DEFAULT_LOG_COUNT); |
495 | if (error) { | ||
495 | xfs_trans_cancel(tp, 0); | 496 | xfs_trans_cancel(tp, 0); |
496 | return (error); | 497 | return (error); |
497 | } | 498 | } |
@@ -638,8 +639,9 @@ xfs_qm_log_quotaoff_end( | |||
638 | 639 | ||
639 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QUOTAOFF_END); | 640 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QUOTAOFF_END); |
640 | 641 | ||
641 | if ((error = xfs_trans_reserve(tp, 0, sizeof(xfs_qoff_logitem_t) * 2, | 642 | error = xfs_trans_reserve(tp, 0, XFS_QM_QUOTAOFF_END_LOG_RES(mp), |
642 | 0, 0, XFS_DEFAULT_LOG_COUNT))) { | 643 | 0, 0, XFS_DEFAULT_LOG_COUNT); |
644 | if (error) { | ||
643 | xfs_trans_cancel(tp, 0); | 645 | xfs_trans_cancel(tp, 0); |
644 | return (error); | 646 | return (error); |
645 | } | 647 | } |
@@ -671,14 +673,10 @@ xfs_qm_log_quotaoff( | |||
671 | uint oldsbqflag=0; | 673 | uint oldsbqflag=0; |
672 | 674 | ||
673 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QUOTAOFF); | 675 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QUOTAOFF); |
674 | if ((error = xfs_trans_reserve(tp, 0, | 676 | error = xfs_trans_reserve(tp, 0, XFS_QM_QUOTAOFF_LOG_RES(mp), |
675 | sizeof(xfs_qoff_logitem_t) * 2 + | 677 | 0, 0, XFS_DEFAULT_LOG_COUNT); |
676 | mp->m_sb.sb_sectsize + 128, | 678 | if (error) |
677 | 0, | ||
678 | 0, | ||
679 | XFS_DEFAULT_LOG_COUNT))) { | ||
680 | goto error0; | 679 | goto error0; |
681 | } | ||
682 | 680 | ||
683 | qoffi = xfs_trans_get_qoff_item(tp, NULL, flags & XFS_ALL_QUOTA_ACCT); | 681 | qoffi = xfs_trans_get_qoff_item(tp, NULL, flags & XFS_ALL_QUOTA_ACCT); |
684 | xfs_trans_log_quotaoff_item(tp, qoffi); | 682 | xfs_trans_log_quotaoff_item(tp, qoffi); |
@@ -784,11 +782,11 @@ xfs_qm_scall_getquota( | |||
784 | (XFS_IS_OQUOTA_ENFORCED(mp) && | 782 | (XFS_IS_OQUOTA_ENFORCED(mp) && |
785 | (dst->d_flags & (FS_PROJ_QUOTA | FS_GROUP_QUOTA)))) && | 783 | (dst->d_flags & (FS_PROJ_QUOTA | FS_GROUP_QUOTA)))) && |
786 | dst->d_id != 0) { | 784 | dst->d_id != 0) { |
787 | if (((int) dst->d_bcount > (int) dst->d_blk_softlimit) && | 785 | if ((dst->d_bcount > dst->d_blk_softlimit) && |
788 | (dst->d_blk_softlimit > 0)) { | 786 | (dst->d_blk_softlimit > 0)) { |
789 | ASSERT(dst->d_btimer != 0); | 787 | ASSERT(dst->d_btimer != 0); |
790 | } | 788 | } |
791 | if (((int) dst->d_icount > (int) dst->d_ino_softlimit) && | 789 | if ((dst->d_icount > dst->d_ino_softlimit) && |
792 | (dst->d_ino_softlimit > 0)) { | 790 | (dst->d_ino_softlimit > 0)) { |
793 | ASSERT(dst->d_itimer != 0); | 791 | ASSERT(dst->d_itimer != 0); |
794 | } | 792 | } |