aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2/ialloc.c
diff options
context:
space:
mode:
authorValerie Henson <val_henson@linux.intel.com>2006-06-25 08:48:12 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:01:12 -0400
commit21730eed11de42f22afcbd43f450a1872a0b5ea1 (patch)
treef695865bce3b87bbc9e1f0a8e61eaeecf8442b06 /fs/ext2/ialloc.c
parent42225a359aa8094242651191ad0ac9c338503d81 (diff)
[PATCH] Make EXT2_DEBUG work again
This patch makes EXT2_DEBUG work again. Due to lack of proper include file, EXT2_DEBUG was undefined in bitmap.c and ext2_count_free() is left out. Moved to balloc.c and removed bitmap.c entirely. Second, debug versions of ext2_count_free_{inodes/blocks} reacquires superblock lock. Moved lock into callers. Signed-off-by: Val Henson <val_henson@linux.intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ext2/ialloc.c')
-rw-r--r--fs/ext2/ialloc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c
index e52765219e16..308c252568c6 100644
--- a/fs/ext2/ialloc.c
+++ b/fs/ext2/ialloc.c
@@ -638,6 +638,7 @@ fail:
638 return ERR_PTR(err); 638 return ERR_PTR(err);
639} 639}
640 640
641/* Superblock must be locked */
641unsigned long ext2_count_free_inodes (struct super_block * sb) 642unsigned long ext2_count_free_inodes (struct super_block * sb)
642{ 643{
643 struct ext2_group_desc *desc; 644 struct ext2_group_desc *desc;
@@ -649,7 +650,6 @@ unsigned long ext2_count_free_inodes (struct super_block * sb)
649 unsigned long bitmap_count = 0; 650 unsigned long bitmap_count = 0;
650 struct buffer_head *bitmap_bh = NULL; 651 struct buffer_head *bitmap_bh = NULL;
651 652
652 lock_super (sb);
653 es = EXT2_SB(sb)->s_es; 653 es = EXT2_SB(sb)->s_es;
654 for (i = 0; i < EXT2_SB(sb)->s_groups_count; i++) { 654 for (i = 0; i < EXT2_SB(sb)->s_groups_count; i++) {
655 unsigned x; 655 unsigned x;
@@ -672,7 +672,6 @@ unsigned long ext2_count_free_inodes (struct super_block * sb)
672 printk("ext2_count_free_inodes: stored = %lu, computed = %lu, %lu\n", 672 printk("ext2_count_free_inodes: stored = %lu, computed = %lu, %lu\n",
673 percpu_counter_read(&EXT2_SB(sb)->s_freeinodes_counter), 673 percpu_counter_read(&EXT2_SB(sb)->s_freeinodes_counter),
674 desc_count, bitmap_count); 674 desc_count, bitmap_count);
675 unlock_super(sb);
676 return desc_count; 675 return desc_count;
677#else 676#else
678 for (i = 0; i < EXT2_SB(sb)->s_groups_count; i++) { 677 for (i = 0; i < EXT2_SB(sb)->s_groups_count; i++) {