OSDN Git Service

[PATCH] remove CONFIG_EXT{2,3}_CHECK
authorAdrian Bunk <bunk@stusta.de>
Wed, 9 Nov 2005 05:34:59 +0000 (21:34 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 9 Nov 2005 15:55:58 +0000 (07:55 -0800)
The CONFIG_EXT{2,3}_CHECK options where were never available, and all they
did was to implement a subset of e2fsck in the kernel.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Documentation/filesystems/ext2.txt
fs/ext2/balloc.c
fs/ext2/ialloc.c
fs/ext2/super.c
fs/ext3/balloc.c
fs/ext3/ialloc.c
fs/ext3/super.c

index d16334e..a8edb37 100644 (file)
@@ -17,8 +17,6 @@ set using tune2fs(8). Kernel-determined defaults are indicated by (*).
 bsddf                  (*)     Makes `df' act like BSD.
 minixdf                                Makes `df' act like Minix.
 
-check                          Check block and inode bitmaps at mount time
-                               (requires CONFIG_EXT2_CHECK).
 check=none, nocheck    (*)     Don't do extra checking of bitmaps on mount
                                (check=normal and check=strict options removed)
 
index 6591abe..bb69080 100644 (file)
@@ -624,76 +624,3 @@ unsigned long ext2_bg_num_gdb(struct super_block *sb, int group)
        return EXT2_SB(sb)->s_gdb_count;
 }
 
-#ifdef CONFIG_EXT2_CHECK
-/* Called at mount-time, super-block is locked */
-void ext2_check_blocks_bitmap (struct super_block * sb)
-{
-       struct buffer_head *bitmap_bh = NULL;
-       struct ext2_super_block * es;
-       unsigned long desc_count, bitmap_count, x, j;
-       unsigned long desc_blocks;
-       struct ext2_group_desc * desc;
-       int i;
-
-       es = EXT2_SB(sb)->s_es;
-       desc_count = 0;
-       bitmap_count = 0;
-       desc = NULL;
-       for (i = 0; i < EXT2_SB(sb)->s_groups_count; i++) {
-               desc = ext2_get_group_desc (sb, i, NULL);
-               if (!desc)
-                       continue;
-               desc_count += le16_to_cpu(desc->bg_free_blocks_count);
-               brelse(bitmap_bh);
-               bitmap_bh = read_block_bitmap(sb, i);
-               if (!bitmap_bh)
-                       continue;
-
-               if (ext2_bg_has_super(sb, i) &&
-                               !ext2_test_bit(0, bitmap_bh->b_data))
-                       ext2_error(sb, __FUNCTION__,
-                                  "Superblock in group %d is marked free", i);
-
-               desc_blocks = ext2_bg_num_gdb(sb, i);
-               for (j = 0; j < desc_blocks; j++)
-                       if (!ext2_test_bit(j + 1, bitmap_bh->b_data))
-                               ext2_error(sb, __FUNCTION__,
-                                          "Descriptor block #%ld in group "
-                                          "%d is marked free", j, i);
-
-               if (!block_in_use(le32_to_cpu(desc->bg_block_bitmap),
-                                       sb, bitmap_bh->b_data))
-                       ext2_error(sb, "ext2_check_blocks_bitmap",
-                                   "Block bitmap for group %d is marked free",
-                                   i);
-
-               if (!block_in_use(le32_to_cpu(desc->bg_inode_bitmap),
-                                       sb, bitmap_bh->b_data))
-                       ext2_error(sb, "ext2_check_blocks_bitmap",
-                                   "Inode bitmap for group %d is marked free",
-                                   i);
-
-               for (j = 0; j < EXT2_SB(sb)->s_itb_per_group; j++)
-                       if (!block_in_use(le32_to_cpu(desc->bg_inode_table) + j,
-                                               sb, bitmap_bh->b_data))
-                               ext2_error (sb, "ext2_check_blocks_bitmap",
-                                           "Block #%ld of the inode table in "
-                                           "group %d is marked free", j, i);
-
-               x = ext2_count_free(bitmap_bh, sb->s_blocksize);
-               if (le16_to_cpu(desc->bg_free_blocks_count) != x)
-                       ext2_error (sb, "ext2_check_blocks_bitmap",
-                                   "Wrong free blocks count for group %d, "
-                                   "stored = %d, counted = %lu", i,
-                                   le16_to_cpu(desc->bg_free_blocks_count), x);
-               bitmap_count += x;
-       }
-       if (le32_to_cpu(es->s_free_blocks_count) != bitmap_count)
-               ext2_error (sb, "ext2_check_blocks_bitmap",
-                       "Wrong free blocks count in super block, "
-                       "stored = %lu, counted = %lu",
-                       (unsigned long)le32_to_cpu(es->s_free_blocks_count),
-                       bitmap_count);
-       brelse(bitmap_bh);
-}
-#endif
index e2d6208..74714af 100644 (file)
@@ -700,43 +700,3 @@ unsigned long ext2_count_dirs (struct super_block * sb)
        return count;
 }
 
-#ifdef CONFIG_EXT2_CHECK
-/* Called at mount-time, super-block is locked */
-void ext2_check_inodes_bitmap (struct super_block * sb)
-{
-       struct ext2_super_block * es = EXT2_SB(sb)->s_es;
-       unsigned long desc_count = 0, bitmap_count = 0;
-       struct buffer_head *bitmap_bh = NULL;
-       int i;
-
-       for (i = 0; i < EXT2_SB(sb)->s_groups_count; i++) {
-               struct ext2_group_desc *desc;
-               unsigned x;
-
-               desc = ext2_get_group_desc(sb, i, NULL);
-               if (!desc)
-                       continue;
-               desc_count += le16_to_cpu(desc->bg_free_inodes_count);
-               brelse(bitmap_bh);
-               bitmap_bh = read_inode_bitmap(sb, i);
-               if (!bitmap_bh)
-                       continue;
-               
-               x = ext2_count_free(bitmap_bh, EXT2_INODES_PER_GROUP(sb) / 8);
-               if (le16_to_cpu(desc->bg_free_inodes_count) != x)
-                       ext2_error (sb, "ext2_check_inodes_bitmap",
-                                   "Wrong free inodes count in group %d, "
-                                   "stored = %d, counted = %lu", i,
-                                   le16_to_cpu(desc->bg_free_inodes_count), x);
-               bitmap_count += x;
-       }
-       brelse(bitmap_bh);
-       if (percpu_counter_read(&EXT2_SB(sb)->s_freeinodes_counter) !=
-                               bitmap_count)
-               ext2_error(sb, "ext2_check_inodes_bitmap",
-                           "Wrong free inodes count in super block, "
-                           "stored = %lu, counted = %lu",
-                           (unsigned long)le32_to_cpu(es->s_free_inodes_count),
-                           bitmap_count);
-}
-#endif
index 3c0c7c6..e4ed4b3 100644 (file)
@@ -281,7 +281,7 @@ static unsigned long get_sb_block(void **data)
 enum {
        Opt_bsd_df, Opt_minix_df, Opt_grpid, Opt_nogrpid,
        Opt_resgid, Opt_resuid, Opt_sb, Opt_err_cont, Opt_err_panic,
-       Opt_err_ro, Opt_nouid32, Opt_check, Opt_nocheck, Opt_debug,
+       Opt_err_ro, Opt_nouid32, Opt_nocheck, Opt_debug,
        Opt_oldalloc, Opt_orlov, Opt_nobh, Opt_user_xattr, Opt_nouser_xattr,
        Opt_acl, Opt_noacl, Opt_xip, Opt_ignore, Opt_err, Opt_quota,
        Opt_usrquota, Opt_grpquota
@@ -303,7 +303,6 @@ static match_table_t tokens = {
        {Opt_nouid32, "nouid32"},
        {Opt_nocheck, "check=none"},
        {Opt_nocheck, "nocheck"},
-       {Opt_check, "check"},
        {Opt_debug, "debug"},
        {Opt_oldalloc, "oldalloc"},
        {Opt_orlov, "orlov"},
@@ -376,13 +375,6 @@ static int parse_options (char * options,
                case Opt_nouid32:
                        set_opt (sbi->s_mount_opt, NO_UID32);
                        break;
-               case Opt_check:
-#ifdef CONFIG_EXT2_CHECK
-                       set_opt (sbi->s_mount_opt, CHECK);
-#else
-                       printk("EXT2 Check option not supported\n");
-#endif
-                       break;
                case Opt_nocheck:
                        clear_opt (sbi->s_mount_opt, CHECK);
                        break;
@@ -503,12 +495,6 @@ static int ext2_setup_super (struct super_block * sb,
                        EXT2_BLOCKS_PER_GROUP(sb),
                        EXT2_INODES_PER_GROUP(sb),
                        sbi->s_mount_opt);
-#ifdef CONFIG_EXT2_CHECK
-       if (test_opt (sb, CHECK)) {
-               ext2_check_blocks_bitmap (sb);
-               ext2_check_inodes_bitmap (sb);
-       }
-#endif
        return res;
 }
 
index 7992d21..ae1148c 100644 (file)
@@ -1517,76 +1517,3 @@ unsigned long ext3_bg_num_gdb(struct super_block *sb, int group)
        return EXT3_SB(sb)->s_gdb_count;
 }
 
-#ifdef CONFIG_EXT3_CHECK
-/* Called at mount-time, super-block is locked */
-void ext3_check_blocks_bitmap (struct super_block * sb)
-{
-       struct ext3_super_block *es;
-       unsigned long desc_count, bitmap_count, x, j;
-       unsigned long desc_blocks;
-       struct buffer_head *bitmap_bh = NULL;
-       struct ext3_group_desc *gdp;
-       int i;
-
-       es = EXT3_SB(sb)->s_es;
-       desc_count = 0;
-       bitmap_count = 0;
-       gdp = NULL;
-       for (i = 0; i < EXT3_SB(sb)->s_groups_count; i++) {
-               gdp = ext3_get_group_desc (sb, i, NULL);
-               if (!gdp)
-                       continue;
-               desc_count += le16_to_cpu(gdp->bg_free_blocks_count);
-               brelse(bitmap_bh);
-               bitmap_bh = read_block_bitmap(sb, i);
-               if (bitmap_bh == NULL)
-                       continue;
-
-               if (ext3_bg_has_super(sb, i) &&
-                               !ext3_test_bit(0, bitmap_bh->b_data))
-                       ext3_error(sb, __FUNCTION__,
-                                  "Superblock in group %d is marked free", i);
-
-               desc_blocks = ext3_bg_num_gdb(sb, i);
-               for (j = 0; j < desc_blocks; j++)
-                       if (!ext3_test_bit(j + 1, bitmap_bh->b_data))
-                               ext3_error(sb, __FUNCTION__,
-                                          "Descriptor block #%ld in group "
-                                          "%d is marked free", j, i);
-
-               if (!block_in_use (le32_to_cpu(gdp->bg_block_bitmap),
-                                               sb, bitmap_bh->b_data))
-                       ext3_error (sb, "ext3_check_blocks_bitmap",
-                                   "Block bitmap for group %d is marked free",
-                                   i);
-
-               if (!block_in_use (le32_to_cpu(gdp->bg_inode_bitmap),
-                                               sb, bitmap_bh->b_data))
-                       ext3_error (sb, "ext3_check_blocks_bitmap",
-                                   "Inode bitmap for group %d is marked free",
-                                   i);
-
-               for (j = 0; j < EXT3_SB(sb)->s_itb_per_group; j++)
-                       if (!block_in_use (le32_to_cpu(gdp->bg_inode_table) + j,
-                                                       sb, bitmap_bh->b_data))
-                               ext3_error (sb, "ext3_check_blocks_bitmap",
-                                           "Block #%d of the inode table in "
-                                           "group %d is marked free", j, i);
-
-               x = ext3_count_free(bitmap_bh, sb->s_blocksize);
-               if (le16_to_cpu(gdp->bg_free_blocks_count) != x)
-                       ext3_error (sb, "ext3_check_blocks_bitmap",
-                                   "Wrong free blocks count for group %d, "
-                                   "stored = %d, counted = %lu", i,
-                                   le16_to_cpu(gdp->bg_free_blocks_count), x);
-               bitmap_count += x;
-       }
-       brelse(bitmap_bh);
-       if (le32_to_cpu(es->s_free_blocks_count) != bitmap_count)
-               ext3_error (sb, "ext3_check_blocks_bitmap",
-                       "Wrong free blocks count in super block, "
-                       "stored = %lu, counted = %lu",
-                       (unsigned long)le32_to_cpu(es->s_free_blocks_count),
-                       bitmap_count);
-}
-#endif
index df3f517..9e4a243 100644 (file)
@@ -756,44 +756,3 @@ unsigned long ext3_count_dirs (struct super_block * sb)
        return count;
 }
 
-#ifdef CONFIG_EXT3_CHECK
-/* Called at mount-time, super-block is locked */
-void ext3_check_inodes_bitmap (struct super_block * sb)
-{
-       struct ext3_super_block * es;
-       unsigned long desc_count, bitmap_count, x;
-       struct buffer_head *bitmap_bh = NULL;
-       struct ext3_group_desc * gdp;
-       int i;
-
-       es = EXT3_SB(sb)->s_es;
-       desc_count = 0;
-       bitmap_count = 0;
-       gdp = NULL;
-       for (i = 0; i < EXT3_SB(sb)->s_groups_count; i++) {
-               gdp = ext3_get_group_desc (sb, i, NULL);
-               if (!gdp)
-                       continue;
-               desc_count += le16_to_cpu(gdp->bg_free_inodes_count);
-               brelse(bitmap_bh);
-               bitmap_bh = read_inode_bitmap(sb, i);
-               if (!bitmap_bh)
-                       continue;
-
-               x = ext3_count_free(bitmap_bh, EXT3_INODES_PER_GROUP(sb) / 8);
-               if (le16_to_cpu(gdp->bg_free_inodes_count) != x)
-                       ext3_error (sb, "ext3_check_inodes_bitmap",
-                                   "Wrong free inodes count in group %d, "
-                                   "stored = %d, counted = %lu", i,
-                                   le16_to_cpu(gdp->bg_free_inodes_count), x);
-               bitmap_count += x;
-       }
-       brelse(bitmap_bh);
-       if (le32_to_cpu(es->s_free_inodes_count) != bitmap_count)
-               ext3_error (sb, "ext3_check_inodes_bitmap",
-                           "Wrong free inodes count in super block, "
-                           "stored = %lu, counted = %lu",
-                           (unsigned long)le32_to_cpu(es->s_free_inodes_count),
-                           bitmap_count);
-}
-#endif
index f594989..4e67306 100644 (file)
@@ -625,7 +625,7 @@ static struct export_operations ext3_export_ops = {
 enum {
        Opt_bsd_df, Opt_minix_df, Opt_grpid, Opt_nogrpid,
        Opt_resgid, Opt_resuid, Opt_sb, Opt_err_cont, Opt_err_panic, Opt_err_ro,
-       Opt_nouid32, Opt_check, Opt_nocheck, Opt_debug, Opt_oldalloc, Opt_orlov,
+       Opt_nouid32, Opt_nocheck, Opt_debug, Opt_oldalloc, Opt_orlov,
        Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl,
        Opt_reservation, Opt_noreservation, Opt_noload, Opt_nobh,
        Opt_commit, Opt_journal_update, Opt_journal_inum,
@@ -652,7 +652,6 @@ static match_table_t tokens = {
        {Opt_nouid32, "nouid32"},
        {Opt_nocheck, "nocheck"},
        {Opt_nocheck, "check=none"},
-       {Opt_check, "check"},
        {Opt_debug, "debug"},
        {Opt_oldalloc, "oldalloc"},
        {Opt_orlov, "orlov"},
@@ -773,14 +772,6 @@ static int parse_options (char * options, struct super_block *sb,
                case Opt_nouid32:
                        set_opt (sbi->s_mount_opt, NO_UID32);
                        break;
-               case Opt_check:
-#ifdef CONFIG_EXT3_CHECK
-                       set_opt (sbi->s_mount_opt, CHECK);
-#else
-                       printk(KERN_ERR
-                              "EXT3 Check option not supported\n");
-#endif
-                       break;
                case Opt_nocheck:
                        clear_opt (sbi->s_mount_opt, CHECK);
                        break;
@@ -1115,12 +1106,6 @@ static int ext3_setup_super(struct super_block *sb, struct ext3_super_block *es,
        } else {
                printk("internal journal\n");
        }
-#ifdef CONFIG_EXT3_CHECK
-       if (test_opt (sb, CHECK)) {
-               ext3_check_blocks_bitmap (sb);
-               ext3_check_inodes_bitmap (sb);
-       }
-#endif
        return res;
 }