f2fs: modify f_blocks for statfs

The f_blocks of statfs include file system overhead,it is not normal
usage of Posix.

Change-Id: If481626b08c05290626938586e2dc721690f1a91
Signed-off-by: Cliff Chen <cliff.chen@rock-chips.com>
This commit is contained in:
Cliff Chen
2018-07-19 16:27:16 +08:00
committed by Tao Huang
parent 78c2dd49b2
commit b992ad3197

View File

@@ -1216,7 +1216,8 @@ static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf)
buf->f_type = F2FS_SUPER_MAGIC;
buf->f_bsize = sbi->blocksize;
buf->f_blocks = total_count - start_count;
/* f_blocks should not include overhead of filesystem */
buf->f_blocks = user_block_count;
buf->f_bfree = user_block_count - valid_user_blocks(sbi) -
sbi->current_reserved_blocks;
if (unlikely(buf->f_bfree <= sbi->unusable_block_count))