aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_qm.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2013-10-14 18:17:52 -0400
committerBen Myers <bpm@sgi.com>2013-10-23 15:28:35 -0400
commit9aede1d81b12a95771db0e2f9196dd37e10aaf20 (patch)
tree380d499202c6d3f5874cff2c32693db8d4d2af81 /fs/xfs/xfs_qm.c
parent5706278758e334bf6a15f57c18dc16df19c83957 (diff)
xfs: split dquot buffer operations out
Parts of userspace want to be able to read and modify dquot buffers (e.g. xfs_db) so we need to split out the reading and writing of these buffers so it is easy to shared code with libxfs in userspace. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_qm.c')
-rw-r--r--fs/xfs/xfs_qm.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index dc2d4f7ad7c9..6dfb4e320498 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -665,20 +665,6 @@ xfs_qm_dqdetach(
665 } 665 }
666} 666}
667 667
668int
669xfs_qm_calc_dquots_per_chunk(
670 struct xfs_mount *mp,
671 unsigned int nbblks) /* basic block units */
672{
673 unsigned int ndquots;
674
675 ASSERT(nbblks > 0);
676 ndquots = BBTOB(nbblks);
677 do_div(ndquots, sizeof(xfs_dqblk_t));
678
679 return ndquots;
680}
681
682struct xfs_qm_isolate { 668struct xfs_qm_isolate {
683 struct list_head buffers; 669 struct list_head buffers;
684 struct list_head dispose; 670 struct list_head dispose;
@@ -859,7 +845,7 @@ xfs_qm_init_quotainfo(
859 845
860 /* Precalc some constants */ 846 /* Precalc some constants */
861 qinf->qi_dqchunklen = XFS_FSB_TO_BB(mp, XFS_DQUOT_CLUSTER_SIZE_FSB); 847 qinf->qi_dqchunklen = XFS_FSB_TO_BB(mp, XFS_DQUOT_CLUSTER_SIZE_FSB);
862 qinf->qi_dqperchunk = xfs_qm_calc_dquots_per_chunk(mp, 848 qinf->qi_dqperchunk = xfs_calc_dquots_per_chunk(mp,
863 qinf->qi_dqchunklen); 849 qinf->qi_dqchunklen);
864 850
865 mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD); 851 mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD);
@@ -1093,10 +1079,10 @@ xfs_qm_reset_dqcounts(
1093 /* 1079 /*
1094 * Do a sanity check, and if needed, repair the dqblk. Don't 1080 * Do a sanity check, and if needed, repair the dqblk. Don't
1095 * output any warnings because it's perfectly possible to 1081 * output any warnings because it's perfectly possible to
1096 * find uninitialised dquot blks. See comment in xfs_qm_dqcheck. 1082 * find uninitialised dquot blks. See comment in xfs_dqcheck.
1097 */ 1083 */
1098 (void) xfs_qm_dqcheck(mp, ddq, id+j, type, XFS_QMOPT_DQREPAIR, 1084 xfs_dqcheck(mp, ddq, id+j, type, XFS_QMOPT_DQREPAIR,
1099 "xfs_quotacheck"); 1085 "xfs_quotacheck");
1100 ddq->d_bcount = 0; 1086 ddq->d_bcount = 0;
1101 ddq->d_icount = 0; 1087 ddq->d_icount = 0;
1102 ddq->d_rtbcount = 0; 1088 ddq->d_rtbcount = 0;