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/ext4 | |
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/ext4')
-rw-r--r-- | fs/ext4/super.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 055a0cd0168e..c89bb8797765 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1458,7 +1458,7 @@ int ext4_group_desc_csum_verify(struct ext4_sb_info *sbi, __u32 block_group, | |||
1458 | } | 1458 | } |
1459 | 1459 | ||
1460 | /* Called at mount-time, super-block is locked */ | 1460 | /* Called at mount-time, super-block is locked */ |
1461 | static int ext4_check_descriptors (struct super_block * sb) | 1461 | static int ext4_check_descriptors(struct super_block *sb) |
1462 | { | 1462 | { |
1463 | struct ext4_sb_info *sbi = EXT4_SB(sb); | 1463 | struct ext4_sb_info *sbi = EXT4_SB(sb); |
1464 | ext4_fsblk_t first_block = le32_to_cpu(sbi->s_es->s_first_data_block); | 1464 | ext4_fsblk_t first_block = le32_to_cpu(sbi->s_es->s_first_data_block); |
@@ -1466,8 +1466,6 @@ static int ext4_check_descriptors (struct super_block * sb) | |||
1466 | ext4_fsblk_t block_bitmap; | 1466 | ext4_fsblk_t block_bitmap; |
1467 | ext4_fsblk_t inode_bitmap; | 1467 | ext4_fsblk_t inode_bitmap; |
1468 | ext4_fsblk_t inode_table; | 1468 | ext4_fsblk_t inode_table; |
1469 | struct ext4_group_desc * gdp = NULL; | ||
1470 | int desc_block = 0; | ||
1471 | int flexbg_flag = 0; | 1469 | int flexbg_flag = 0; |
1472 | ext4_group_t i; | 1470 | ext4_group_t i; |
1473 | 1471 | ||
@@ -1476,17 +1474,15 @@ static int ext4_check_descriptors (struct super_block * sb) | |||
1476 | 1474 | ||
1477 | ext4_debug ("Checking group descriptors"); | 1475 | ext4_debug ("Checking group descriptors"); |
1478 | 1476 | ||
1479 | for (i = 0; i < sbi->s_groups_count; i++) | 1477 | for (i = 0; i < sbi->s_groups_count; i++) { |
1480 | { | 1478 | struct ext4_group_desc *gdp = ext4_get_group_desc(sb, i, NULL); |
1479 | |||
1481 | if (i == sbi->s_groups_count - 1 || flexbg_flag) | 1480 | if (i == sbi->s_groups_count - 1 || flexbg_flag) |
1482 | last_block = ext4_blocks_count(sbi->s_es) - 1; | 1481 | last_block = ext4_blocks_count(sbi->s_es) - 1; |
1483 | else | 1482 | else |
1484 | last_block = first_block + | 1483 | last_block = first_block + |
1485 | (EXT4_BLOCKS_PER_GROUP(sb) - 1); | 1484 | (EXT4_BLOCKS_PER_GROUP(sb) - 1); |
1486 | 1485 | ||
1487 | if ((i % EXT4_DESC_PER_BLOCK(sb)) == 0) | ||
1488 | gdp = (struct ext4_group_desc *) | ||
1489 | sbi->s_group_desc[desc_block++]->b_data; | ||
1490 | block_bitmap = ext4_block_bitmap(sb, gdp); | 1486 | block_bitmap = ext4_block_bitmap(sb, gdp); |
1491 | if (block_bitmap < first_block || block_bitmap > last_block) | 1487 | if (block_bitmap < first_block || block_bitmap > last_block) |
1492 | { | 1488 | { |
@@ -1524,8 +1520,6 @@ static int ext4_check_descriptors (struct super_block * sb) | |||
1524 | } | 1520 | } |
1525 | if (!flexbg_flag) | 1521 | if (!flexbg_flag) |
1526 | first_block += EXT4_BLOCKS_PER_GROUP(sb); | 1522 | first_block += EXT4_BLOCKS_PER_GROUP(sb); |
1527 | gdp = (struct ext4_group_desc *) | ||
1528 | ((__u8 *)gdp + EXT4_DESC_SIZE(sb)); | ||
1529 | } | 1523 | } |
1530 | 1524 | ||
1531 | ext4_free_blocks_count_set(sbi->s_es, ext4_count_free_blocks(sb)); | 1525 | ext4_free_blocks_count_set(sbi->s_es, ext4_count_free_blocks(sb)); |