diff options
Diffstat (limited to 'fs/ext2/ialloc.c')
-rw-r--r-- | fs/ext2/ialloc.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c index e2d6208633a7..74714af4ae69 100644 --- a/fs/ext2/ialloc.c +++ b/fs/ext2/ialloc.c | |||
@@ -700,43 +700,3 @@ unsigned long ext2_count_dirs (struct super_block * sb) | |||
700 | return count; | 700 | return count; |
701 | } | 701 | } |
702 | 702 | ||
703 | #ifdef CONFIG_EXT2_CHECK | ||
704 | /* Called at mount-time, super-block is locked */ | ||
705 | void ext2_check_inodes_bitmap (struct super_block * sb) | ||
706 | { | ||
707 | struct ext2_super_block * es = EXT2_SB(sb)->s_es; | ||
708 | unsigned long desc_count = 0, bitmap_count = 0; | ||
709 | struct buffer_head *bitmap_bh = NULL; | ||
710 | int i; | ||
711 | |||
712 | for (i = 0; i < EXT2_SB(sb)->s_groups_count; i++) { | ||
713 | struct ext2_group_desc *desc; | ||
714 | unsigned x; | ||
715 | |||
716 | desc = ext2_get_group_desc(sb, i, NULL); | ||
717 | if (!desc) | ||
718 | continue; | ||
719 | desc_count += le16_to_cpu(desc->bg_free_inodes_count); | ||
720 | brelse(bitmap_bh); | ||
721 | bitmap_bh = read_inode_bitmap(sb, i); | ||
722 | if (!bitmap_bh) | ||
723 | continue; | ||
724 | |||
725 | x = ext2_count_free(bitmap_bh, EXT2_INODES_PER_GROUP(sb) / 8); | ||
726 | if (le16_to_cpu(desc->bg_free_inodes_count) != x) | ||
727 | ext2_error (sb, "ext2_check_inodes_bitmap", | ||
728 | "Wrong free inodes count in group %d, " | ||
729 | "stored = %d, counted = %lu", i, | ||
730 | le16_to_cpu(desc->bg_free_inodes_count), x); | ||
731 | bitmap_count += x; | ||
732 | } | ||
733 | brelse(bitmap_bh); | ||
734 | if (percpu_counter_read(&EXT2_SB(sb)->s_freeinodes_counter) != | ||
735 | bitmap_count) | ||
736 | ext2_error(sb, "ext2_check_inodes_bitmap", | ||
737 | "Wrong free inodes count in super block, " | ||
738 | "stored = %lu, counted = %lu", | ||
739 | (unsigned long)le32_to_cpu(es->s_free_inodes_count), | ||
740 | bitmap_count); | ||
741 | } | ||
742 | #endif | ||