aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_qm.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_qm.c')
-rw-r--r--fs/xfs/xfs_qm.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index d0acb4e40a6f..f41702b43003 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -617,6 +617,20 @@ xfs_qm_dqdetach(
617 } 617 }
618} 618}
619 619
620int
621xfs_qm_calc_dquots_per_chunk(
622 struct xfs_mount *mp,
623 unsigned int nbblks) /* basic block units */
624{
625 unsigned int ndquots;
626
627 ASSERT(nbblks > 0);
628 ndquots = BBTOB(nbblks);
629 do_div(ndquots, sizeof(xfs_dqblk_t));
630
631 return ndquots;
632}
633
620/* 634/*
621 * This initializes all the quota information that's kept in the 635 * This initializes all the quota information that's kept in the
622 * mount structure 636 * mount structure
@@ -656,9 +670,8 @@ xfs_qm_init_quotainfo(
656 670
657 /* Precalc some constants */ 671 /* Precalc some constants */
658 qinf->qi_dqchunklen = XFS_FSB_TO_BB(mp, XFS_DQUOT_CLUSTER_SIZE_FSB); 672 qinf->qi_dqchunklen = XFS_FSB_TO_BB(mp, XFS_DQUOT_CLUSTER_SIZE_FSB);
659 ASSERT(qinf->qi_dqchunklen); 673 qinf->qi_dqperchunk = xfs_qm_calc_dquots_per_chunk(mp,
660 qinf->qi_dqperchunk = BBTOB(qinf->qi_dqchunklen); 674 qinf->qi_dqchunklen);
661 do_div(qinf->qi_dqperchunk, sizeof(xfs_dqblk_t));
662 675
663 mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD); 676 mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD);
664 677
@@ -897,6 +910,10 @@ xfs_qm_dqiter_bufs(
897 if (error) 910 if (error)
898 break; 911 break;
899 912
913 /*
914 * XXX(hch): need to figure out if it makes sense to validate
915 * the CRC here.
916 */
900 xfs_qm_reset_dqcounts(mp, bp, firstid, type); 917 xfs_qm_reset_dqcounts(mp, bp, firstid, type);
901 xfs_buf_delwri_queue(bp, buffer_list); 918 xfs_buf_delwri_queue(bp, buffer_list);
902 xfs_buf_relse(bp); 919 xfs_buf_relse(bp);