]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ext2/super.c
drivers/char/synclink_gt.c: don't return an uninitialised local
[linux-2.6-omap-h63xx.git] / fs / ext2 / super.c
index 7e6867329220cb55cbd9069d342be37f5a2e5760..ef50cbc792db94668b9d7deecc22c50076511fe4 100644 (file)
@@ -89,7 +89,7 @@ void ext2_update_dynamic_rev(struct super_block *sb)
        if (le32_to_cpu(es->s_rev_level) > EXT2_GOOD_OLD_REV)
                return;
 
-       ext2_warning(sb, __FUNCTION__,
+       ext2_warning(sb, __func__,
                     "updating to rev %d because of new feature flag, "
                     "running e2fsck is recommended",
                     EXT2_DYNAMIC_REV);
@@ -621,13 +621,13 @@ static int ext2_check_descriptors(struct super_block *sb)
 {
        int i;
        struct ext2_sb_info *sbi = EXT2_SB(sb);
-       unsigned long first_block = le32_to_cpu(sbi->s_es->s_first_data_block);
-       unsigned long last_block;
 
        ext2_debug ("Checking group descriptors");
 
        for (i = 0; i < sbi->s_groups_count; i++) {
                struct ext2_group_desc *gdp = ext2_get_group_desc(sb, i, NULL);
+               ext2_fsblk_t first_block = ext2_group_first_block_no(sb, i);
+               ext2_fsblk_t last_block;
 
                if (i == sbi->s_groups_count - 1)
                        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)
                                    i, (unsigned long) le32_to_cpu(gdp->bg_inode_table));
                        return 0;
                }
-               first_block += EXT2_BLOCKS_PER_GROUP(sb);
        }
        return 1;
 }
@@ -720,10 +719,9 @@ static unsigned long descriptor_loc(struct super_block *sb,
                                    int nr)
 {
        struct ext2_sb_info *sbi = EXT2_SB(sb);
-       unsigned long bg, first_data_block, first_meta_bg;
+       unsigned long bg, first_meta_bg;
        int has_super = 0;
        
-       first_data_block = le32_to_cpu(sbi->s_es->s_first_data_block);
        first_meta_bg = le32_to_cpu(sbi->s_es->s_first_meta_bg);
 
        if (!EXT2_HAS_INCOMPAT_FEATURE(sb, EXT2_FEATURE_INCOMPAT_META_BG) ||
@@ -732,7 +730,8 @@ static unsigned long descriptor_loc(struct super_block *sb,
        bg = sbi->s_desc_per_block * nr;
        if (ext2_bg_has_super(sb, bg))
                has_super = 1;
-       return (first_data_block + has_super + (bg * sbi->s_blocks_per_group));
+
+       return ext2_group_first_block_no(sb, bg) + has_super;
 }
 
 static int ext2_fill_super(struct super_block *sb, void *data, int silent)
@@ -1061,7 +1060,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
                goto failed_mount3;
        }
        if (EXT2_HAS_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_HAS_JOURNAL))
-               ext2_warning(sb, __FUNCTION__,
+               ext2_warning(sb, __func__,
                        "mounting ext3 filesystem as ext2");
        ext2_setup_super (sb, es, sb->s_flags & MS_RDONLY);
        return 0;
@@ -1178,7 +1177,7 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
        if (((sbi->s_mount_opt & EXT2_MOUNT_XIP) !=
            (old_mount_opt & EXT2_MOUNT_XIP)) &&
            invalidate_inodes(sb))
-               ext2_warning(sb, __FUNCTION__, "busy inodes while remounting "\
+               ext2_warning(sb, __func__, "busy inodes while remounting "\
                             "xip remain in cache (no functional problem)");
        if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
                return 0;