diff mbox series

ext2: show more accurate free block count in debug message

Message ID 20190718012236.22618-1-cgxu519@zoho.com.cn
State Not Applicable
Headers show
Series ext2: show more accurate free block count in debug message | expand

Commit Message

Chengguang Xu July 18, 2019, 1:22 a.m. UTC
Show more accurate free block count in debug message by replacing
es->s_free_blocks_count to sbi->s_freeblocks_counter in
ext2_count_free_blocks().

Signed-off-by: Chengguang Xu <cgxu519@zoho.com.cn>
---
 fs/ext2/balloc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jan Kara July 29, 2019, 1:17 p.m. UTC | #1
On Thu 18-07-19 09:22:36, Chengguang Xu wrote:
> Show more accurate free block count in debug message by replacing
> es->s_free_blocks_count to sbi->s_freeblocks_counter in
> ext2_count_free_blocks().
> 
> Signed-off-by: Chengguang Xu <cgxu519@zoho.com.cn>

Thanks for the patch but I don't think this really makes any big
difference. So let's just not introduce unnecessary churn.

								Honza

> ---
>  fs/ext2/balloc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
> index 547c165299c0..8c587533cead 100644
> --- a/fs/ext2/balloc.c
> +++ b/fs/ext2/balloc.c
> @@ -1495,7 +1495,8 @@ unsigned long ext2_count_free_blocks (struct super_block * sb)
>  		brelse(bitmap_bh);
>  	}
>  	printk("ext2_count_free_blocks: stored = %lu, computed = %lu, %lu\n",
> -		(long)le32_to_cpu(es->s_free_blocks_count),
> +		(unsigned long)
> +		percpu_counter_read(&EXT2_SB(sb)->s_freeblocks_counter),
>  		desc_count, bitmap_count);
>  	return bitmap_count;
>  #else
> -- 
> 2.21.0
> 
> 
> 
>
diff mbox series

Patch

diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
index 547c165299c0..8c587533cead 100644
--- a/fs/ext2/balloc.c
+++ b/fs/ext2/balloc.c
@@ -1495,7 +1495,8 @@  unsigned long ext2_count_free_blocks (struct super_block * sb)
 		brelse(bitmap_bh);
 	}
 	printk("ext2_count_free_blocks: stored = %lu, computed = %lu, %lu\n",
-		(long)le32_to_cpu(es->s_free_blocks_count),
+		(unsigned long)
+		percpu_counter_read(&EXT2_SB(sb)->s_freeblocks_counter),
 		desc_count, bitmap_count);
 	return bitmap_count;
 #else