aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2/super.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2008-04-28 05:16:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:43 -0400
commit24097d12efbb97bff14fb6e350508853db0f9595 (patch)
treefb451eaebde9550954493b8a17949e6cce16782d /fs/ext2/super.c
parentbbff28602436cc7ca660757bba81f03b99e8586d (diff)
ext2: use ext2_group_first_block_no()
Use ext2_group_first_block_no() and assign the return values to ext2_fsblk_t variables. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: <linux-ext4@vger.kernel.org> 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.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 7e6867329220..3f745fb5fff3 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -621,13 +621,13 @@ static int ext2_check_descriptors(struct super_block *sb)
621{ 621{
622 int i; 622 int i;
623 struct ext2_sb_info *sbi = EXT2_SB(sb); 623 struct ext2_sb_info *sbi = EXT2_SB(sb);
624 unsigned long first_block = le32_to_cpu(sbi->s_es->s_first_data_block);
625 unsigned long last_block;
626 624
627 ext2_debug ("Checking group descriptors"); 625 ext2_debug ("Checking group descriptors");
628 626
629 for (i = 0; i < sbi->s_groups_count; i++) { 627 for (i = 0; i < sbi->s_groups_count; i++) {
630 struct ext2_group_desc *gdp = ext2_get_group_desc(sb, i, NULL); 628 struct ext2_group_desc *gdp = ext2_get_group_desc(sb, i, NULL);
629 ext2_fsblk_t first_block = ext2_group_first_block_no(sb, i);
630 ext2_fsblk_t last_block;
631 631
632 if (i == sbi->s_groups_count - 1) 632 if (i == sbi->s_groups_count - 1)
633 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;
@@ -663,7 +663,6 @@ static int ext2_check_descriptors(struct super_block *sb)
663 i, (unsigned long) le32_to_cpu(gdp->bg_inode_table)); 663 i, (unsigned long) le32_to_cpu(gdp->bg_inode_table));
664 return 0; 664 return 0;
665 } 665 }
666 first_block += EXT2_BLOCKS_PER_GROUP(sb);
667 } 666 }
668 return 1; 667 return 1;
669} 668}
@@ -720,10 +719,9 @@ static unsigned long descriptor_loc(struct super_block *sb,
720 int nr) 719 int nr)
721{ 720{
722 struct ext2_sb_info *sbi = EXT2_SB(sb); 721 struct ext2_sb_info *sbi = EXT2_SB(sb);
723 unsigned long bg, first_data_block, first_meta_bg; 722 unsigned long bg, first_meta_bg;
724 int has_super = 0; 723 int has_super = 0;
725 724
726 first_data_block = le32_to_cpu(sbi->s_es->s_first_data_block);
727 first_meta_bg = le32_to_cpu(sbi->s_es->s_first_meta_bg); 725 first_meta_bg = le32_to_cpu(sbi->s_es->s_first_meta_bg);
728 726
729 if (!EXT2_HAS_INCOMPAT_FEATURE(sb, EXT2_FEATURE_INCOMPAT_META_BG) || 727 if (!EXT2_HAS_INCOMPAT_FEATURE(sb, EXT2_FEATURE_INCOMPAT_META_BG) ||
@@ -732,7 +730,8 @@ static unsigned long descriptor_loc(struct super_block *sb,
732 bg = sbi->s_desc_per_block * nr; 730 bg = sbi->s_desc_per_block * nr;
733 if (ext2_bg_has_super(sb, bg)) 731 if (ext2_bg_has_super(sb, bg))
734 has_super = 1; 732 has_super = 1;
735 return (first_data_block + has_super + (bg * sbi->s_blocks_per_group)); 733
734 return ext2_group_first_block_no(sb, bg) + has_super;
736} 735}
737 736
738static int ext2_fill_super(struct super_block *sb, void *data, int silent) 737static int ext2_fill_super(struct super_block *sb, void *data, int silent)