Skip to content

Commit

Permalink
btrfs: fix wrong data space statistics
Browse files Browse the repository at this point in the history
Josef has implemented mixed data/metadata chunks, we must add those chunks'
space just like data chunks.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Reviewed-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Miao Xie authored and Chris Mason committed Jan 16, 2011
1 parent f580eb0 commit 299a08b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fs/btrfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,11 +790,10 @@ static int btrfs_statfs(struct dentry *dentry, struct kstatfs *buf)

rcu_read_lock();
list_for_each_entry_rcu(found, head, list) {
if (found->flags & (BTRFS_BLOCK_GROUP_METADATA |
BTRFS_BLOCK_GROUP_SYSTEM))
total_used_data += found->disk_total;
else
if (found->flags & BTRFS_BLOCK_GROUP_DATA)
total_used_data += found->disk_used;
else
total_used_data += found->disk_total;
total_used += found->disk_used;
}
rcu_read_unlock();
Expand Down

0 comments on commit 299a08b

Please sign in to comment.