diff options
author | Theodore Ts'o <tytso@mit.edu> | 2011-09-09 19:08:51 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-09-09 19:08:51 -0400 |
commit | 021b65bb1e4e4b625c80bbb82651e5e155721ef3 (patch) | |
tree | e1826a0ec395ac2acf46c43113f2c6a64a5165d0 /fs/ext4/super.c | |
parent | 6f16b60690ba04cf476480a6f19b204e4b95b4a6 (diff) |
ext4: Rename ext4_free_blks_{count,set}() to refer to clusters
The field bg_free_blocks_count_{lo,high} in the block group
descriptor has been repurposed to hold the number of free clusters for
bigalloc functions. So rename the functions so it makes it easier to
read and audit the block allocation and block freeing code.
Note: at this point in bigalloc development we doesn't support
online resize, so this also makes it really obvious all of the places
we need to fix up to add support for online resize.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 66b8cfa15636..30cf0e1bd89c 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -163,8 +163,8 @@ ext4_fsblk_t ext4_inode_table(struct super_block *sb, | |||
163 | (ext4_fsblk_t)le32_to_cpu(bg->bg_inode_table_hi) << 32 : 0); | 163 | (ext4_fsblk_t)le32_to_cpu(bg->bg_inode_table_hi) << 32 : 0); |
164 | } | 164 | } |
165 | 165 | ||
166 | __u32 ext4_free_blks_count(struct super_block *sb, | 166 | __u32 ext4_free_group_clusters(struct super_block *sb, |
167 | struct ext4_group_desc *bg) | 167 | struct ext4_group_desc *bg) |
168 | { | 168 | { |
169 | return le16_to_cpu(bg->bg_free_blocks_count_lo) | | 169 | return le16_to_cpu(bg->bg_free_blocks_count_lo) | |
170 | (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT ? | 170 | (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT ? |
@@ -219,8 +219,8 @@ void ext4_inode_table_set(struct super_block *sb, | |||
219 | bg->bg_inode_table_hi = cpu_to_le32(blk >> 32); | 219 | bg->bg_inode_table_hi = cpu_to_le32(blk >> 32); |
220 | } | 220 | } |
221 | 221 | ||
222 | void ext4_free_blks_set(struct super_block *sb, | 222 | void ext4_free_group_clusters_set(struct super_block *sb, |
223 | struct ext4_group_desc *bg, __u32 count) | 223 | struct ext4_group_desc *bg, __u32 count) |
224 | { | 224 | { |
225 | bg->bg_free_blocks_count_lo = cpu_to_le16((__u16)count); | 225 | bg->bg_free_blocks_count_lo = cpu_to_le16((__u16)count); |
226 | if (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT) | 226 | if (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT) |
@@ -2034,7 +2034,7 @@ static int ext4_fill_flex_info(struct super_block *sb) | |||
2034 | flex_group = ext4_flex_group(sbi, i); | 2034 | flex_group = ext4_flex_group(sbi, i); |
2035 | atomic_add(ext4_free_inodes_count(sb, gdp), | 2035 | atomic_add(ext4_free_inodes_count(sb, gdp), |
2036 | &sbi->s_flex_groups[flex_group].free_inodes); | 2036 | &sbi->s_flex_groups[flex_group].free_inodes); |
2037 | atomic_add(ext4_free_blks_count(sb, gdp), | 2037 | atomic_add(ext4_free_group_clusters(sb, gdp), |
2038 | &sbi->s_flex_groups[flex_group].free_clusters); | 2038 | &sbi->s_flex_groups[flex_group].free_clusters); |
2039 | atomic_add(ext4_used_dirs_count(sb, gdp), | 2039 | atomic_add(ext4_used_dirs_count(sb, gdp), |
2040 | &sbi->s_flex_groups[flex_group].used_dirs); | 2040 | &sbi->s_flex_groups[flex_group].used_dirs); |