diff options
Diffstat (limited to 'fs/xfs/xfs_qm.c')
-rw-r--r-- | fs/xfs/xfs_qm.c | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c index 3e6c2e6c9cd2..14a4996cfec6 100644 --- a/fs/xfs/xfs_qm.c +++ b/fs/xfs/xfs_qm.c | |||
@@ -17,31 +17,28 @@ | |||
17 | */ | 17 | */ |
18 | #include "xfs.h" | 18 | #include "xfs.h" |
19 | #include "xfs_fs.h" | 19 | #include "xfs_fs.h" |
20 | #include "xfs_shared.h" | ||
20 | #include "xfs_format.h" | 21 | #include "xfs_format.h" |
22 | #include "xfs_log_format.h" | ||
23 | #include "xfs_trans_resv.h" | ||
21 | #include "xfs_bit.h" | 24 | #include "xfs_bit.h" |
22 | #include "xfs_log.h" | ||
23 | #include "xfs_trans.h" | ||
24 | #include "xfs_sb.h" | 25 | #include "xfs_sb.h" |
25 | #include "xfs_ag.h" | 26 | #include "xfs_ag.h" |
26 | #include "xfs_alloc.h" | ||
27 | #include "xfs_quota.h" | ||
28 | #include "xfs_mount.h" | 27 | #include "xfs_mount.h" |
29 | #include "xfs_bmap_btree.h" | ||
30 | #include "xfs_ialloc_btree.h" | ||
31 | #include "xfs_dinode.h" | ||
32 | #include "xfs_inode.h" | 28 | #include "xfs_inode.h" |
33 | #include "xfs_ialloc.h" | 29 | #include "xfs_ialloc.h" |
34 | #include "xfs_itable.h" | 30 | #include "xfs_itable.h" |
35 | #include "xfs_rtalloc.h" | 31 | #include "xfs_quota.h" |
36 | #include "xfs_error.h" | 32 | #include "xfs_error.h" |
37 | #include "xfs_bmap.h" | 33 | #include "xfs_bmap.h" |
38 | #include "xfs_attr.h" | 34 | #include "xfs_bmap_btree.h" |
39 | #include "xfs_buf_item.h" | 35 | #include "xfs_trans.h" |
40 | #include "xfs_trans_space.h" | 36 | #include "xfs_trans_space.h" |
41 | #include "xfs_qm.h" | 37 | #include "xfs_qm.h" |
42 | #include "xfs_trace.h" | 38 | #include "xfs_trace.h" |
43 | #include "xfs_icache.h" | 39 | #include "xfs_icache.h" |
44 | #include "xfs_cksum.h" | 40 | #include "xfs_cksum.h" |
41 | #include "xfs_dinode.h" | ||
45 | 42 | ||
46 | /* | 43 | /* |
47 | * The global quota manager. There is only one of these for the entire | 44 | * The global quota manager. There is only one of these for the entire |
@@ -664,20 +661,6 @@ xfs_qm_dqdetach( | |||
664 | } | 661 | } |
665 | } | 662 | } |
666 | 663 | ||
667 | int | ||
668 | xfs_qm_calc_dquots_per_chunk( | ||
669 | struct xfs_mount *mp, | ||
670 | unsigned int nbblks) /* basic block units */ | ||
671 | { | ||
672 | unsigned int ndquots; | ||
673 | |||
674 | ASSERT(nbblks > 0); | ||
675 | ndquots = BBTOB(nbblks); | ||
676 | do_div(ndquots, sizeof(xfs_dqblk_t)); | ||
677 | |||
678 | return ndquots; | ||
679 | } | ||
680 | |||
681 | struct xfs_qm_isolate { | 664 | struct xfs_qm_isolate { |
682 | struct list_head buffers; | 665 | struct list_head buffers; |
683 | struct list_head dispose; | 666 | struct list_head dispose; |
@@ -858,7 +841,7 @@ xfs_qm_init_quotainfo( | |||
858 | 841 | ||
859 | /* Precalc some constants */ | 842 | /* Precalc some constants */ |
860 | qinf->qi_dqchunklen = XFS_FSB_TO_BB(mp, XFS_DQUOT_CLUSTER_SIZE_FSB); | 843 | qinf->qi_dqchunklen = XFS_FSB_TO_BB(mp, XFS_DQUOT_CLUSTER_SIZE_FSB); |
861 | qinf->qi_dqperchunk = xfs_qm_calc_dquots_per_chunk(mp, | 844 | qinf->qi_dqperchunk = xfs_calc_dquots_per_chunk(mp, |
862 | qinf->qi_dqchunklen); | 845 | qinf->qi_dqchunklen); |
863 | 846 | ||
864 | mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD); | 847 | mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD); |
@@ -1092,10 +1075,10 @@ xfs_qm_reset_dqcounts( | |||
1092 | /* | 1075 | /* |
1093 | * Do a sanity check, and if needed, repair the dqblk. Don't | 1076 | * Do a sanity check, and if needed, repair the dqblk. Don't |
1094 | * output any warnings because it's perfectly possible to | 1077 | * output any warnings because it's perfectly possible to |
1095 | * find uninitialised dquot blks. See comment in xfs_qm_dqcheck. | 1078 | * find uninitialised dquot blks. See comment in xfs_dqcheck. |
1096 | */ | 1079 | */ |
1097 | (void) xfs_qm_dqcheck(mp, ddq, id+j, type, XFS_QMOPT_DQREPAIR, | 1080 | xfs_dqcheck(mp, ddq, id+j, type, XFS_QMOPT_DQREPAIR, |
1098 | "xfs_quotacheck"); | 1081 | "xfs_quotacheck"); |
1099 | ddq->d_bcount = 0; | 1082 | ddq->d_bcount = 0; |
1100 | ddq->d_icount = 0; | 1083 | ddq->d_icount = 0; |
1101 | ddq->d_rtbcount = 0; | 1084 | ddq->d_rtbcount = 0; |