Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 251752
b: refs/heads/master
c: d02a939
h: refs/heads/master
v: v3
  • Loading branch information
Kazuya Mio authored and Theodore Ts'o committed May 24, 2011
1 parent a2c39e5 commit 611f330
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 28739eea9cd42598b632972f5cc64a458c5d40b3
refs/heads/master: d02a9391f79cab65cde74cd9e8ccd2290a565229
5 changes: 4 additions & 1 deletion trunk/fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -4458,6 +4458,7 @@ static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf)
struct ext4_sb_info *sbi = EXT4_SB(sb);
struct ext4_super_block *es = sbi->s_es;
u64 fsid;
s64 bfree;

if (test_opt(sb, MINIX_DF)) {
sbi->s_overhead_last = 0;
Expand Down Expand Up @@ -4501,8 +4502,10 @@ static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf)
buf->f_type = EXT4_SUPER_MAGIC;
buf->f_bsize = sb->s_blocksize;
buf->f_blocks = ext4_blocks_count(es) - sbi->s_overhead_last;
buf->f_bfree = percpu_counter_sum_positive(&sbi->s_freeblocks_counter) -
bfree = percpu_counter_sum_positive(&sbi->s_freeblocks_counter) -
percpu_counter_sum_positive(&sbi->s_dirtyblocks_counter);
/* prevent underflow in case that few free space is available */
buf->f_bfree = max_t(s64, bfree, 0);
buf->f_bavail = buf->f_bfree - ext4_r_blocks_count(es);
if (buf->f_bfree < ext4_r_blocks_count(es))
buf->f_bavail = 0;
Expand Down

0 comments on commit 611f330

Please sign in to comment.