linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 1/6] btrfs: fix wrong data space statistics
@ 2011-01-05 10:07 Miao Xie
  2011-01-12 13:49 ` Josef Bacik
  0 siblings, 1 reply; 2+ messages in thread
From: Miao Xie @ 2011-01-05 10:07 UTC (permalink / raw)
  To: Josef Bacik, Chris Mason, Mitch Harder; +Cc: Linux Btrfs

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>
---
 fs/btrfs/super.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 61bd79a..1d21208 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -768,11 +768,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();
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH V3 1/6] btrfs: fix wrong data space statistics
  2011-01-05 10:07 [PATCH V3 1/6] btrfs: fix wrong data space statistics Miao Xie
@ 2011-01-12 13:49 ` Josef Bacik
  0 siblings, 0 replies; 2+ messages in thread
From: Josef Bacik @ 2011-01-12 13:49 UTC (permalink / raw)
  To: Miao Xie; +Cc: Josef Bacik, Chris Mason, Mitch Harder, Linux Btrfs

On Wed, Jan 05, 2011 at 06:07:15PM +0800, Miao Xie wrote:
> 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>

Thanks,

Josef

> ---
>  fs/btrfs/super.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 61bd79a..1d21208 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -768,11 +768,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();
> -- 
> 1.7.2.3
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-12 13:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-05 10:07 [PATCH V3 1/6] btrfs: fix wrong data space statistics Miao Xie
2011-01-12 13:49 ` Josef Bacik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).