aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ext2/balloc.c14
-rw-r--r--fs/ext2/ialloc.c1
2 files changed, 3 insertions, 12 deletions
diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
index 1c361399886..376aa77f3ca 100644
--- a/fs/ext2/balloc.c
+++ b/fs/ext2/balloc.c
@@ -1444,19 +1444,9 @@ ext2_fsblk_t ext2_new_block(struct inode *inode, unsigned long goal, int *errp)
1444 1444
1445#ifdef EXT2FS_DEBUG 1445#ifdef EXT2FS_DEBUG
1446 1446
1447static const int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0}; 1447unsigned long ext2_count_free(struct buffer_head *map, unsigned int numchars)
1448
1449unsigned long ext2_count_free (struct buffer_head * map, unsigned int numchars)
1450{ 1448{
1451 unsigned int i; 1449 return numchars * BITS_PER_BYTE - memweight(map->b_data, numchars);
1452 unsigned long sum = 0;
1453
1454 if (!map)
1455 return (0);
1456 for (i = 0; i < numchars; i++)
1457 sum += nibblemap[map->b_data[i] & 0xf] +
1458 nibblemap[(map->b_data[i] >> 4) & 0xf];
1459 return (sum);
1460} 1450}
1461 1451
1462#endif /* EXT2FS_DEBUG */ 1452#endif /* EXT2FS_DEBUG */
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c
index c13eb7b91a1..8f370e012e6 100644
--- a/fs/ext2/ialloc.c
+++ b/fs/ext2/ialloc.c
@@ -644,6 +644,7 @@ unsigned long ext2_count_free_inodes (struct super_block * sb)
644 } 644 }
645 brelse(bitmap_bh); 645 brelse(bitmap_bh);
646 printk("ext2_count_free_inodes: stored = %lu, computed = %lu, %lu\n", 646 printk("ext2_count_free_inodes: stored = %lu, computed = %lu, %lu\n",
647 (unsigned long)
647 percpu_counter_read(&EXT2_SB(sb)->s_freeinodes_counter), 648 percpu_counter_read(&EXT2_SB(sb)->s_freeinodes_counter),
648 desc_count, bitmap_count); 649 desc_count, bitmap_count);
649 return desc_count; 650 return desc_count;