diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2008-02-06 04:40:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-06 13:41:21 -0500 |
commit | 197cd65accc6a274dabcd81f4811ba5d9a4856df (patch) | |
tree | a41f7b375887c505f8c6a374ad643bb4c1222ed5 /fs/ext3 | |
parent | 144704e5227362cbd694b0b3c3aa4ac99a0115c9 (diff) |
ext[234]: use ext[234]_get_group_desc()
Use ext[234]_get_group_desc() to get group descriptor from group number.
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ext3')
-rw-r--r-- | fs/ext3/super.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 15e75139b7e..343677e8c35 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -1252,28 +1252,24 @@ static int ext3_setup_super(struct super_block *sb, struct ext3_super_block *es, | |||
1252 | } | 1252 | } |
1253 | 1253 | ||
1254 | /* Called at mount-time, super-block is locked */ | 1254 | /* Called at mount-time, super-block is locked */ |
1255 | static int ext3_check_descriptors (struct super_block * sb) | 1255 | static int ext3_check_descriptors(struct super_block *sb) |
1256 | { | 1256 | { |
1257 | struct ext3_sb_info *sbi = EXT3_SB(sb); | 1257 | struct ext3_sb_info *sbi = EXT3_SB(sb); |
1258 | ext3_fsblk_t first_block = le32_to_cpu(sbi->s_es->s_first_data_block); | 1258 | ext3_fsblk_t first_block = le32_to_cpu(sbi->s_es->s_first_data_block); |
1259 | ext3_fsblk_t last_block; | 1259 | ext3_fsblk_t last_block; |
1260 | struct ext3_group_desc * gdp = NULL; | ||
1261 | int desc_block = 0; | ||
1262 | int i; | 1260 | int i; |
1263 | 1261 | ||
1264 | ext3_debug ("Checking group descriptors"); | 1262 | ext3_debug ("Checking group descriptors"); |
1265 | 1263 | ||
1266 | for (i = 0; i < sbi->s_groups_count; i++) | 1264 | for (i = 0; i < sbi->s_groups_count; i++) { |
1267 | { | 1265 | struct ext3_group_desc *gdp = ext3_get_group_desc(sb, i, NULL); |
1266 | |||
1268 | if (i == sbi->s_groups_count - 1) | 1267 | if (i == sbi->s_groups_count - 1) |
1269 | last_block = le32_to_cpu(sbi->s_es->s_blocks_count) - 1; | 1268 | last_block = le32_to_cpu(sbi->s_es->s_blocks_count) - 1; |
1270 | else | 1269 | else |
1271 | last_block = first_block + | 1270 | last_block = first_block + |
1272 | (EXT3_BLOCKS_PER_GROUP(sb) - 1); | 1271 | (EXT3_BLOCKS_PER_GROUP(sb) - 1); |
1273 | 1272 | ||
1274 | if ((i % EXT3_DESC_PER_BLOCK(sb)) == 0) | ||
1275 | gdp = (struct ext3_group_desc *) | ||
1276 | sbi->s_group_desc[desc_block++]->b_data; | ||
1277 | if (le32_to_cpu(gdp->bg_block_bitmap) < first_block || | 1273 | if (le32_to_cpu(gdp->bg_block_bitmap) < first_block || |
1278 | le32_to_cpu(gdp->bg_block_bitmap) > last_block) | 1274 | le32_to_cpu(gdp->bg_block_bitmap) > last_block) |
1279 | { | 1275 | { |
@@ -1306,7 +1302,6 @@ static int ext3_check_descriptors (struct super_block * sb) | |||
1306 | return 0; | 1302 | return 0; |
1307 | } | 1303 | } |
1308 | first_block += EXT3_BLOCKS_PER_GROUP(sb); | 1304 | first_block += EXT3_BLOCKS_PER_GROUP(sb); |
1309 | gdp++; | ||
1310 | } | 1305 | } |
1311 | 1306 | ||
1312 | sbi->s_es->s_free_blocks_count=cpu_to_le32(ext3_count_free_blocks(sb)); | 1307 | sbi->s_es->s_free_blocks_count=cpu_to_le32(ext3_count_free_blocks(sb)); |