aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2012-02-19 21:28:17 -0500
committerBen Myers <bpm@sgi.com>2012-02-29 15:09:06 -0500
commit89605011915aec5c6194e53a9f02631d68aea6bc (patch)
tree9c8745156d1fbefcf28cf0cf5114ed4c4ef63f4c /fs/xfs
parent18535a7e019e6fb9cdcefd43007bc72a67bf99ee (diff)
xfs: include reservations in quota reporting
Report all quota usage including the currently pending reservations. This avoids the need to flush delalloc space before gathering quota information, and matches quota enforcement, which already takes the reservations into account. This fixes xfstests 270. Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_qm_bhv.c24
-rw-r--r--fs/xfs/xfs_qm_syscalls.c6
2 files changed, 15 insertions, 15 deletions
diff --git a/fs/xfs/xfs_qm_bhv.c b/fs/xfs/xfs_qm_bhv.c
index a0a829addca9..e4e37877f867 100644
--- a/fs/xfs/xfs_qm_bhv.c
+++ b/fs/xfs/xfs_qm_bhv.c
@@ -40,28 +40,28 @@
40STATIC void 40STATIC void
41xfs_fill_statvfs_from_dquot( 41xfs_fill_statvfs_from_dquot(
42 struct kstatfs *statp, 42 struct kstatfs *statp,
43 xfs_disk_dquot_t *dp) 43 struct xfs_dquot *dqp)
44{ 44{
45 __uint64_t limit; 45 __uint64_t limit;
46 46
47 limit = dp->d_blk_softlimit ? 47 limit = dqp->q_core.d_blk_softlimit ?
48 be64_to_cpu(dp->d_blk_softlimit) : 48 be64_to_cpu(dqp->q_core.d_blk_softlimit) :
49 be64_to_cpu(dp->d_blk_hardlimit); 49 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
50 if (limit && statp->f_blocks > limit) { 50 if (limit && statp->f_blocks > limit) {
51 statp->f_blocks = limit; 51 statp->f_blocks = limit;
52 statp->f_bfree = statp->f_bavail = 52 statp->f_bfree = statp->f_bavail =
53 (statp->f_blocks > be64_to_cpu(dp->d_bcount)) ? 53 (statp->f_blocks > dqp->q_res_bcount) ?
54 (statp->f_blocks - be64_to_cpu(dp->d_bcount)) : 0; 54 (statp->f_blocks - dqp->q_res_bcount) : 0;
55 } 55 }
56 56
57 limit = dp->d_ino_softlimit ? 57 limit = dqp->q_core.d_ino_softlimit ?
58 be64_to_cpu(dp->d_ino_softlimit) : 58 be64_to_cpu(dqp->q_core.d_ino_softlimit) :
59 be64_to_cpu(dp->d_ino_hardlimit); 59 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
60 if (limit && statp->f_files > limit) { 60 if (limit && statp->f_files > limit) {
61 statp->f_files = limit; 61 statp->f_files = limit;
62 statp->f_ffree = 62 statp->f_ffree =
63 (statp->f_files > be64_to_cpu(dp->d_icount)) ? 63 (statp->f_files > dqp->q_res_icount) ?
64 (statp->f_ffree - be64_to_cpu(dp->d_icount)) : 0; 64 (statp->f_ffree - dqp->q_res_icount) : 0;
65 } 65 }
66} 66}
67 67
@@ -82,7 +82,7 @@ xfs_qm_statvfs(
82 xfs_dquot_t *dqp; 82 xfs_dquot_t *dqp;
83 83
84 if (!xfs_qm_dqget(mp, NULL, xfs_get_projid(ip), XFS_DQ_PROJ, 0, &dqp)) { 84 if (!xfs_qm_dqget(mp, NULL, xfs_get_projid(ip), XFS_DQ_PROJ, 0, &dqp)) {
85 xfs_fill_statvfs_from_dquot(statp, &dqp->q_core); 85 xfs_fill_statvfs_from_dquot(statp, dqp);
86 xfs_qm_dqput(dqp); 86 xfs_qm_dqput(dqp);
87 } 87 }
88} 88}
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index 2b85641f33c8..b9ac268a2d7c 100644
--- a/fs/xfs/xfs_qm_syscalls.c
+++ b/fs/xfs/xfs_qm_syscalls.c
@@ -758,8 +758,8 @@ xfs_qm_scall_getquota(
758 XFS_FSB_TO_BB(mp, be64_to_cpu(dqp->q_core.d_blk_softlimit)); 758 XFS_FSB_TO_BB(mp, be64_to_cpu(dqp->q_core.d_blk_softlimit));
759 dst->d_ino_hardlimit = be64_to_cpu(dqp->q_core.d_ino_hardlimit); 759 dst->d_ino_hardlimit = be64_to_cpu(dqp->q_core.d_ino_hardlimit);
760 dst->d_ino_softlimit = be64_to_cpu(dqp->q_core.d_ino_softlimit); 760 dst->d_ino_softlimit = be64_to_cpu(dqp->q_core.d_ino_softlimit);
761 dst->d_bcount = XFS_FSB_TO_BB(mp, be64_to_cpu(dqp->q_core.d_bcount)); 761 dst->d_bcount = XFS_FSB_TO_BB(mp, dqp->q_res_bcount);
762 dst->d_icount = be64_to_cpu(dqp->q_core.d_icount); 762 dst->d_icount = dqp->q_res_icount;
763 dst->d_btimer = be32_to_cpu(dqp->q_core.d_btimer); 763 dst->d_btimer = be32_to_cpu(dqp->q_core.d_btimer);
764 dst->d_itimer = be32_to_cpu(dqp->q_core.d_itimer); 764 dst->d_itimer = be32_to_cpu(dqp->q_core.d_itimer);
765 dst->d_iwarns = be16_to_cpu(dqp->q_core.d_iwarns); 765 dst->d_iwarns = be16_to_cpu(dqp->q_core.d_iwarns);
@@ -768,7 +768,7 @@ xfs_qm_scall_getquota(
768 XFS_FSB_TO_BB(mp, be64_to_cpu(dqp->q_core.d_rtb_hardlimit)); 768 XFS_FSB_TO_BB(mp, be64_to_cpu(dqp->q_core.d_rtb_hardlimit));
769 dst->d_rtb_softlimit = 769 dst->d_rtb_softlimit =
770 XFS_FSB_TO_BB(mp, be64_to_cpu(dqp->q_core.d_rtb_softlimit)); 770 XFS_FSB_TO_BB(mp, be64_to_cpu(dqp->q_core.d_rtb_softlimit));
771 dst->d_rtbcount = XFS_FSB_TO_BB(mp, be64_to_cpu(dqp->q_core.d_rtbcount)); 771 dst->d_rtbcount = XFS_FSB_TO_BB(mp, dqp->q_res_rtbcount);
772 dst->d_rtbtimer = be32_to_cpu(dqp->q_core.d_rtbtimer); 772 dst->d_rtbtimer = be32_to_cpu(dqp->q_core.d_rtbtimer);
773 dst->d_rtbwarns = be16_to_cpu(dqp->q_core.d_rtbwarns); 773 dst->d_rtbwarns = be16_to_cpu(dqp->q_core.d_rtbwarns);
774 774