Commit 94ee039d authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds

[PATCH] ext3 cleanup 1

Rename variables in ext3/balloc.c as was done in ext2 a couple of years
ago.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 77579d37
...@@ -43,34 +43,34 @@ struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb, ...@@ -43,34 +43,34 @@ struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb,
struct buffer_head ** bh) struct buffer_head ** bh)
{ {
unsigned long group_desc; unsigned long group_desc;
unsigned long desc; unsigned long offset;
struct ext3_group_desc * gdp; struct ext3_group_desc * desc;
struct ext3_sb_info *sbi = EXT3_SB(sb);
if (block_group >= EXT3_SB(sb)->s_groups_count) { if (block_group >= sbi->s_groups_count) {
ext3_error (sb, "ext3_get_group_desc", ext3_error (sb, "ext3_get_group_desc",
"block_group >= groups_count - " "block_group >= groups_count - "
"block_group = %d, groups_count = %lu", "block_group = %d, groups_count = %lu",
block_group, EXT3_SB(sb)->s_groups_count); block_group, sbi->s_groups_count);
return NULL; return NULL;
} }
smp_rmb(); smp_rmb();
group_desc = block_group >> EXT3_DESC_PER_BLOCK_BITS(sb); group_desc = block_group >> EXT3_DESC_PER_BLOCK_BITS(sb);
desc = block_group & (EXT3_DESC_PER_BLOCK(sb) - 1); offset = block_group & (EXT3_DESC_PER_BLOCK(sb) - 1);
if (!EXT3_SB(sb)->s_group_desc[group_desc]) { if (!sbi->s_group_desc[group_desc]) {
ext3_error (sb, "ext3_get_group_desc", ext3_error (sb, "ext3_get_group_desc",
"Group descriptor not loaded - " "Group descriptor not loaded - "
"block_group = %d, group_desc = %lu, desc = %lu", "block_group = %d, group_desc = %lu, desc = %lu",
block_group, group_desc, desc); block_group, group_desc, offset);
return NULL; return NULL;
} }
gdp = (struct ext3_group_desc *) desc = (struct ext3_group_desc *) sbi->s_group_desc[group_desc]->b_data;
EXT3_SB(sb)->s_group_desc[group_desc]->b_data;
if (bh) if (bh)
*bh = EXT3_SB(sb)->s_group_desc[group_desc]; *bh = sbi->s_group_desc[group_desc];
return gdp + desc; return desc + offset;
} }
/* /*
...@@ -284,14 +284,14 @@ void ext3_free_blocks_sb(handle_t *handle, struct super_block *sb, ...@@ -284,14 +284,14 @@ void ext3_free_blocks_sb(handle_t *handle, struct super_block *sb,
unsigned long bit; unsigned long bit;
unsigned long i; unsigned long i;
unsigned long overflow; unsigned long overflow;
struct ext3_group_desc * gdp; struct ext3_group_desc * desc;
struct ext3_super_block * es; struct ext3_super_block * es;
struct ext3_sb_info *sbi; struct ext3_sb_info *sbi;
int err = 0, ret; int err = 0, ret;
*pdquot_freed_blocks = 0; *pdquot_freed_blocks = 0;
sbi = EXT3_SB(sb); sbi = EXT3_SB(sb);
es = EXT3_SB(sb)->s_es; es = sbi->s_es;
if (block < le32_to_cpu(es->s_first_data_block) || if (block < le32_to_cpu(es->s_first_data_block) ||
block + count < block || block + count < block ||
block + count > le32_to_cpu(es->s_blocks_count)) { block + count > le32_to_cpu(es->s_blocks_count)) {
...@@ -301,7 +301,7 @@ void ext3_free_blocks_sb(handle_t *handle, struct super_block *sb, ...@@ -301,7 +301,7 @@ void ext3_free_blocks_sb(handle_t *handle, struct super_block *sb,
goto error_return; goto error_return;
} }
ext3_debug ("freeing block %lu\n", block); ext3_debug ("freeing block(s) %lu-%lu\n", block, block + count - 1);
do_more: do_more:
overflow = 0; overflow = 0;
...@@ -321,16 +321,16 @@ void ext3_free_blocks_sb(handle_t *handle, struct super_block *sb, ...@@ -321,16 +321,16 @@ void ext3_free_blocks_sb(handle_t *handle, struct super_block *sb,
bitmap_bh = read_block_bitmap(sb, block_group); bitmap_bh = read_block_bitmap(sb, block_group);
if (!bitmap_bh) if (!bitmap_bh)
goto error_return; goto error_return;
gdp = ext3_get_group_desc (sb, block_group, &gd_bh); desc = ext3_get_group_desc (sb, block_group, &gd_bh);
if (!gdp) if (!desc)
goto error_return; goto error_return;
if (in_range (le32_to_cpu(gdp->bg_block_bitmap), block, count) || if (in_range (le32_to_cpu(desc->bg_block_bitmap), block, count) ||
in_range (le32_to_cpu(gdp->bg_inode_bitmap), block, count) || in_range (le32_to_cpu(desc->bg_inode_bitmap), block, count) ||
in_range (block, le32_to_cpu(gdp->bg_inode_table), in_range (block, le32_to_cpu(desc->bg_inode_table),
EXT3_SB(sb)->s_itb_per_group) || sbi->s_itb_per_group) ||
in_range (block + count - 1, le32_to_cpu(gdp->bg_inode_table), in_range (block + count - 1, le32_to_cpu(desc->bg_inode_table),
EXT3_SB(sb)->s_itb_per_group)) sbi->s_itb_per_group))
ext3_error (sb, "ext3_free_blocks", ext3_error (sb, "ext3_free_blocks",
"Freeing blocks in system zones - " "Freeing blocks in system zones - "
"Block = %lu, count = %lu", "Block = %lu, count = %lu",
...@@ -1428,9 +1428,8 @@ unsigned long ext3_count_free_blocks(struct super_block *sb) ...@@ -1428,9 +1428,8 @@ unsigned long ext3_count_free_blocks(struct super_block *sb)
#endif #endif
} }
static inline int block_in_use(unsigned long block, static inline int
struct super_block * sb, block_in_use(unsigned long block, struct super_block *sb, unsigned char *map)
unsigned char * map)
{ {
return ext3_test_bit ((block - return ext3_test_bit ((block -
le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block)) % le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block)) %
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment