diff options
Diffstat (limited to 'fs/xfs/quota')
-rw-r--r-- | fs/xfs/quota/xfs_qm_bhv.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/fs/xfs/quota/xfs_qm_bhv.c b/fs/xfs/quota/xfs_qm_bhv.c index e95e99f7168f..f137856c3261 100644 --- a/fs/xfs/quota/xfs_qm_bhv.c +++ b/fs/xfs/quota/xfs_qm_bhv.c | |||
@@ -217,17 +217,24 @@ xfs_qm_statvfs( | |||
217 | return 0; | 217 | return 0; |
218 | dp = &dqp->q_core; | 218 | dp = &dqp->q_core; |
219 | 219 | ||
220 | limit = dp->d_blk_softlimit ? dp->d_blk_softlimit : dp->d_blk_hardlimit; | 220 | limit = dp->d_blk_softlimit ? |
221 | be64_to_cpu(dp->d_blk_softlimit) : | ||
222 | be64_to_cpu(dp->d_blk_hardlimit); | ||
221 | if (limit && statp->f_blocks > limit) { | 223 | if (limit && statp->f_blocks > limit) { |
222 | statp->f_blocks = limit; | 224 | statp->f_blocks = limit; |
223 | statp->f_bfree = (statp->f_blocks > dp->d_bcount) ? | 225 | statp->f_bfree = |
224 | (statp->f_blocks - dp->d_bcount) : 0; | 226 | (statp->f_blocks > be64_to_cpu(dp->d_bcount)) ? |
227 | (statp->f_blocks - be64_to_cpu(dp->d_bcount)) : 0; | ||
225 | } | 228 | } |
226 | limit = dp->d_ino_softlimit ? dp->d_ino_softlimit : dp->d_ino_hardlimit; | 229 | |
230 | limit = dp->d_ino_softlimit ? | ||
231 | be64_to_cpu(dp->d_ino_softlimit) : | ||
232 | be64_to_cpu(dp->d_ino_hardlimit); | ||
227 | if (limit && statp->f_files > limit) { | 233 | if (limit && statp->f_files > limit) { |
228 | statp->f_files = limit; | 234 | statp->f_files = limit; |
229 | statp->f_ffree = (statp->f_files > dp->d_icount) ? | 235 | statp->f_ffree = |
230 | (statp->f_ffree - dp->d_icount) : 0; | 236 | (statp->f_files > be64_to_cpu(dp->d_icount)) ? |
237 | (statp->f_ffree - be64_to_cpu(dp->d_icount)) : 0; | ||
231 | } | 238 | } |
232 | 239 | ||
233 | xfs_qm_dqput(dqp); | 240 | xfs_qm_dqput(dqp); |