diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2009-01-05 22:20:24 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-01-05 22:20:24 -0500 |
commit | 560671a0d3c9ad2d647fa6d09375a262e1f19c4f (patch) | |
tree | a52673326726062d53b35643d51a16739cd804fc /fs/ext4/mballoc.c | |
parent | e8134b27e351e813414da3b95aa8eac6d3908088 (diff) |
ext4: Use high 16 bits of the block group descriptor's free counts fields
Rename the lower bits with suffix _lo and add helper
to access the values. Also rename bg_itable_unused_hi
to bg_pad as in e2fsprogs.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r-- | fs/ext4/mballoc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index d559a03f3eb2..3809a9348f29 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -2515,7 +2515,7 @@ int ext4_mb_add_groupinfo(struct super_block *sb, ext4_group_t group, | |||
2515 | ext4_free_blocks_after_init(sb, group, desc); | 2515 | ext4_free_blocks_after_init(sb, group, desc); |
2516 | } else { | 2516 | } else { |
2517 | meta_group_info[i]->bb_free = | 2517 | meta_group_info[i]->bb_free = |
2518 | le16_to_cpu(desc->bg_free_blocks_count); | 2518 | ext4_free_blks_count(sb, desc); |
2519 | } | 2519 | } |
2520 | 2520 | ||
2521 | INIT_LIST_HEAD(&meta_group_info[i]->bb_prealloc_list); | 2521 | INIT_LIST_HEAD(&meta_group_info[i]->bb_prealloc_list); |
@@ -3046,12 +3046,12 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac, | |||
3046 | ac->ac_b_ex.fe_start, ac->ac_b_ex.fe_len); | 3046 | ac->ac_b_ex.fe_start, ac->ac_b_ex.fe_len); |
3047 | if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) { | 3047 | if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) { |
3048 | gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT); | 3048 | gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT); |
3049 | gdp->bg_free_blocks_count = | 3049 | ext4_free_blks_set(sb, gdp, |
3050 | cpu_to_le16(ext4_free_blocks_after_init(sb, | 3050 | ext4_free_blocks_after_init(sb, |
3051 | ac->ac_b_ex.fe_group, | 3051 | ac->ac_b_ex.fe_group, gdp)); |
3052 | gdp)); | ||
3053 | } | 3052 | } |
3054 | le16_add_cpu(&gdp->bg_free_blocks_count, -ac->ac_b_ex.fe_len); | 3053 | len = ext4_free_blks_count(sb, gdp) - ac->ac_b_ex.fe_len; |
3054 | ext4_free_blks_set(sb, gdp, len); | ||
3055 | gdp->bg_checksum = ext4_group_desc_csum(sbi, ac->ac_b_ex.fe_group, gdp); | 3055 | gdp->bg_checksum = ext4_group_desc_csum(sbi, ac->ac_b_ex.fe_group, gdp); |
3056 | spin_unlock(sb_bgl_lock(sbi, ac->ac_b_ex.fe_group)); | 3056 | spin_unlock(sb_bgl_lock(sbi, ac->ac_b_ex.fe_group)); |
3057 | percpu_counter_sub(&sbi->s_freeblocks_counter, ac->ac_b_ex.fe_len); | 3057 | percpu_counter_sub(&sbi->s_freeblocks_counter, ac->ac_b_ex.fe_len); |
@@ -4823,7 +4823,8 @@ do_more: | |||
4823 | } | 4823 | } |
4824 | 4824 | ||
4825 | spin_lock(sb_bgl_lock(sbi, block_group)); | 4825 | spin_lock(sb_bgl_lock(sbi, block_group)); |
4826 | le16_add_cpu(&gdp->bg_free_blocks_count, count); | 4826 | ret = ext4_free_blks_count(sb, gdp) + count; |
4827 | ext4_free_blks_set(sb, gdp, ret); | ||
4827 | gdp->bg_checksum = ext4_group_desc_csum(sbi, block_group, gdp); | 4828 | gdp->bg_checksum = ext4_group_desc_csum(sbi, block_group, gdp); |
4828 | spin_unlock(sb_bgl_lock(sbi, block_group)); | 4829 | spin_unlock(sb_bgl_lock(sbi, block_group)); |
4829 | percpu_counter_add(&sbi->s_freeblocks_counter, count); | 4830 | percpu_counter_add(&sbi->s_freeblocks_counter, count); |