diff options
author | Theodore Ts'o <tytso@mit.edu> | 2011-09-09 18:56:51 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-09-09 18:56:51 -0400 |
commit | 5704265188ffe4290ed73b3cb685206c3ed8209d (patch) | |
tree | 6bc51bea59625b2a7c8e4b74bbb66884371f74dd /fs/ext4/mballoc.c | |
parent | 0aa060000e83ca3d09ddc446a7174fb0820d99bc (diff) |
ext4: convert s_{dirty,free}blocks_counter to s_{dirty,free}clusters_counter
Convert the percpu counters s_dirtyblocks_counter and
s_freeblocks_counter in struct ext4_super_info to be
s_dirtyclusters_counter and s_freeclusters_counter.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r-- | fs/ext4/mballoc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 57ce6960e940..4a38b65bd564 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -2834,13 +2834,14 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac, | |||
2834 | gdp->bg_checksum = ext4_group_desc_csum(sbi, ac->ac_b_ex.fe_group, gdp); | 2834 | gdp->bg_checksum = ext4_group_desc_csum(sbi, ac->ac_b_ex.fe_group, gdp); |
2835 | 2835 | ||
2836 | ext4_unlock_group(sb, ac->ac_b_ex.fe_group); | 2836 | ext4_unlock_group(sb, ac->ac_b_ex.fe_group); |
2837 | percpu_counter_sub(&sbi->s_freeblocks_counter, ac->ac_b_ex.fe_len); | 2837 | percpu_counter_sub(&sbi->s_freeclusters_counter, ac->ac_b_ex.fe_len); |
2838 | /* | 2838 | /* |
2839 | * Now reduce the dirty block count also. Should not go negative | 2839 | * Now reduce the dirty block count also. Should not go negative |
2840 | */ | 2840 | */ |
2841 | if (!(ac->ac_flags & EXT4_MB_DELALLOC_RESERVED)) | 2841 | if (!(ac->ac_flags & EXT4_MB_DELALLOC_RESERVED)) |
2842 | /* release all the reserved blocks if non delalloc */ | 2842 | /* release all the reserved blocks if non delalloc */ |
2843 | percpu_counter_sub(&sbi->s_dirtyblocks_counter, reserv_clstrs); | 2843 | percpu_counter_sub(&sbi->s_dirtyclusters_counter, |
2844 | reserv_clstrs); | ||
2844 | 2845 | ||
2845 | if (sbi->s_log_groups_per_flex) { | 2846 | if (sbi->s_log_groups_per_flex) { |
2846 | ext4_group_t flex_group = ext4_flex_group(sbi, | 2847 | ext4_group_t flex_group = ext4_flex_group(sbi, |
@@ -4384,7 +4385,7 @@ out: | |||
4384 | if (!ext4_test_inode_state(ar->inode, | 4385 | if (!ext4_test_inode_state(ar->inode, |
4385 | EXT4_STATE_DELALLOC_RESERVED)) | 4386 | EXT4_STATE_DELALLOC_RESERVED)) |
4386 | /* release all the reserved blocks if non delalloc */ | 4387 | /* release all the reserved blocks if non delalloc */ |
4387 | percpu_counter_sub(&sbi->s_dirtyblocks_counter, | 4388 | percpu_counter_sub(&sbi->s_dirtyclusters_counter, |
4388 | reserv_clstrs); | 4389 | reserv_clstrs); |
4389 | } | 4390 | } |
4390 | 4391 | ||
@@ -4691,7 +4692,7 @@ do_more: | |||
4691 | ext4_free_blks_set(sb, gdp, ret); | 4692 | ext4_free_blks_set(sb, gdp, ret); |
4692 | gdp->bg_checksum = ext4_group_desc_csum(sbi, block_group, gdp); | 4693 | gdp->bg_checksum = ext4_group_desc_csum(sbi, block_group, gdp); |
4693 | ext4_unlock_group(sb, block_group); | 4694 | ext4_unlock_group(sb, block_group); |
4694 | percpu_counter_add(&sbi->s_freeblocks_counter, count); | 4695 | percpu_counter_add(&sbi->s_freeclusters_counter, count_clusters); |
4695 | 4696 | ||
4696 | if (sbi->s_log_groups_per_flex) { | 4697 | if (sbi->s_log_groups_per_flex) { |
4697 | ext4_group_t flex_group = ext4_flex_group(sbi, block_group); | 4698 | ext4_group_t flex_group = ext4_flex_group(sbi, block_group); |
@@ -4833,7 +4834,8 @@ int ext4_group_add_blocks(handle_t *handle, struct super_block *sb, | |||
4833 | ext4_free_blks_set(sb, desc, blk_free_count); | 4834 | ext4_free_blks_set(sb, desc, blk_free_count); |
4834 | desc->bg_checksum = ext4_group_desc_csum(sbi, block_group, desc); | 4835 | desc->bg_checksum = ext4_group_desc_csum(sbi, block_group, desc); |
4835 | ext4_unlock_group(sb, block_group); | 4836 | ext4_unlock_group(sb, block_group); |
4836 | percpu_counter_add(&sbi->s_freeblocks_counter, blocks_freed); | 4837 | percpu_counter_add(&sbi->s_freeclusters_counter, |
4838 | EXT4_B2C(sbi, blocks_freed)); | ||
4837 | 4839 | ||
4838 | if (sbi->s_log_groups_per_flex) { | 4840 | if (sbi->s_log_groups_per_flex) { |
4839 | ext4_group_t flex_group = ext4_flex_group(sbi, block_group); | 4841 | ext4_group_t flex_group = ext4_flex_group(sbi, block_group); |