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/ext2/super.c | |
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/ext2/super.c')
-rw-r--r-- | fs/ext2/super.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 75af3fbe838..1ba18b72d43 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
@@ -617,27 +617,24 @@ static int ext2_setup_super (struct super_block * sb, | |||
617 | return res; | 617 | return res; |
618 | } | 618 | } |
619 | 619 | ||
620 | static int ext2_check_descriptors (struct super_block * sb) | 620 | static int ext2_check_descriptors(struct super_block *sb) |
621 | { | 621 | { |
622 | int i; | 622 | int i; |
623 | int desc_block = 0; | ||
624 | struct ext2_sb_info *sbi = EXT2_SB(sb); | 623 | struct ext2_sb_info *sbi = EXT2_SB(sb); |
625 | unsigned long first_block = le32_to_cpu(sbi->s_es->s_first_data_block); | 624 | unsigned long first_block = le32_to_cpu(sbi->s_es->s_first_data_block); |
626 | unsigned long last_block; | 625 | unsigned long last_block; |
627 | struct ext2_group_desc * gdp = NULL; | ||
628 | 626 | ||
629 | ext2_debug ("Checking group descriptors"); | 627 | ext2_debug ("Checking group descriptors"); |
630 | 628 | ||
631 | for (i = 0; i < sbi->s_groups_count; i++) | 629 | for (i = 0; i < sbi->s_groups_count; i++) { |
632 | { | 630 | struct ext2_group_desc *gdp = ext2_get_group_desc(sb, i, NULL); |
631 | |||
633 | if (i == sbi->s_groups_count - 1) | 632 | if (i == sbi->s_groups_count - 1) |
634 | last_block = le32_to_cpu(sbi->s_es->s_blocks_count) - 1; | 633 | last_block = le32_to_cpu(sbi->s_es->s_blocks_count) - 1; |
635 | else | 634 | else |
636 | last_block = first_block + | 635 | last_block = first_block + |
637 | (EXT2_BLOCKS_PER_GROUP(sb) - 1); | 636 | (EXT2_BLOCKS_PER_GROUP(sb) - 1); |
638 | 637 | ||
639 | if ((i % EXT2_DESC_PER_BLOCK(sb)) == 0) | ||
640 | gdp = (struct ext2_group_desc *) sbi->s_group_desc[desc_block++]->b_data; | ||
641 | if (le32_to_cpu(gdp->bg_block_bitmap) < first_block || | 638 | if (le32_to_cpu(gdp->bg_block_bitmap) < first_block || |
642 | le32_to_cpu(gdp->bg_block_bitmap) > last_block) | 639 | le32_to_cpu(gdp->bg_block_bitmap) > last_block) |
643 | { | 640 | { |
@@ -667,7 +664,6 @@ static int ext2_check_descriptors (struct super_block * sb) | |||
667 | return 0; | 664 | return 0; |
668 | } | 665 | } |
669 | first_block += EXT2_BLOCKS_PER_GROUP(sb); | 666 | first_block += EXT2_BLOCKS_PER_GROUP(sb); |
670 | gdp++; | ||
671 | } | 667 | } |
672 | return 1; | 668 | return 1; |
673 | } | 669 | } |