diff options
-rw-r--r-- | fs/ext4/balloc.c | 3 | ||||
-rw-r--r-- | fs/ext4/bitmap.c | 8 | ||||
-rw-r--r-- | fs/ext4/ext4.h | 2 | ||||
-rw-r--r-- | fs/ext4/ialloc.c | 3 |
4 files changed, 8 insertions, 8 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index cee7812cc3cf..d23b31ca9d7a 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c | |||
@@ -609,7 +609,8 @@ ext4_fsblk_t ext4_count_free_clusters(struct super_block *sb) | |||
609 | if (bitmap_bh == NULL) | 609 | if (bitmap_bh == NULL) |
610 | continue; | 610 | continue; |
611 | 611 | ||
612 | x = ext4_count_free(bitmap_bh, sb->s_blocksize); | 612 | x = ext4_count_free(bitmap_bh->b_data, |
613 | EXT4_BLOCKS_PER_GROUP(sb) / 8); | ||
613 | printk(KERN_DEBUG "group %u: stored = %d, counted = %u\n", | 614 | printk(KERN_DEBUG "group %u: stored = %d, counted = %u\n", |
614 | i, ext4_free_group_clusters(sb, gdp), x); | 615 | i, ext4_free_group_clusters(sb, gdp), x); |
615 | bitmap_count += x; | 616 | bitmap_count += x; |
diff --git a/fs/ext4/bitmap.c b/fs/ext4/bitmap.c index b319721da26a..7e86a6d28c64 100644 --- a/fs/ext4/bitmap.c +++ b/fs/ext4/bitmap.c | |||
@@ -15,15 +15,13 @@ | |||
15 | 15 | ||
16 | static const int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0}; | 16 | static const int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0}; |
17 | 17 | ||
18 | unsigned int ext4_count_free(struct buffer_head *map, unsigned int numchars) | 18 | unsigned int ext4_count_free(char *bitmap, unsigned int numchars) |
19 | { | 19 | { |
20 | unsigned int i, sum = 0; | 20 | unsigned int i, sum = 0; |
21 | 21 | ||
22 | if (!map) | ||
23 | return 0; | ||
24 | for (i = 0; i < numchars; i++) | 22 | for (i = 0; i < numchars; i++) |
25 | sum += nibblemap[map->b_data[i] & 0xf] + | 23 | sum += nibblemap[bitmap[i] & 0xf] + |
26 | nibblemap[(map->b_data[i] >> 4) & 0xf]; | 24 | nibblemap[(bitmap[i] >> 4) & 0xf]; |
27 | return sum; | 25 | return sum; |
28 | } | 26 | } |
29 | 27 | ||
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index cfc4e01b3c83..293fa1ced21b 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -1852,7 +1852,7 @@ struct mmpd_data { | |||
1852 | # define NORET_AND noreturn, | 1852 | # define NORET_AND noreturn, |
1853 | 1853 | ||
1854 | /* bitmap.c */ | 1854 | /* bitmap.c */ |
1855 | extern unsigned int ext4_count_free(struct buffer_head *, unsigned); | 1855 | extern unsigned int ext4_count_free(char *bitmap, unsigned numchars); |
1856 | void ext4_inode_bitmap_csum_set(struct super_block *sb, ext4_group_t group, | 1856 | void ext4_inode_bitmap_csum_set(struct super_block *sb, ext4_group_t group, |
1857 | struct ext4_group_desc *gdp, | 1857 | struct ext4_group_desc *gdp, |
1858 | struct buffer_head *bh, int sz); | 1858 | struct buffer_head *bh, int sz); |
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index d48e8b14928c..6866bc233e94 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
@@ -1054,7 +1054,8 @@ unsigned long ext4_count_free_inodes(struct super_block *sb) | |||
1054 | if (!bitmap_bh) | 1054 | if (!bitmap_bh) |
1055 | continue; | 1055 | continue; |
1056 | 1056 | ||
1057 | x = ext4_count_free(bitmap_bh, EXT4_INODES_PER_GROUP(sb) / 8); | 1057 | x = ext4_count_free(bitmap_bh->b_data, |
1058 | EXT4_INODES_PER_GROUP(sb) / 8); | ||
1058 | printk(KERN_DEBUG "group %lu: stored = %d, counted = %lu\n", | 1059 | printk(KERN_DEBUG "group %lu: stored = %d, counted = %lu\n", |
1059 | (unsigned long) i, ext4_free_inodes_count(sb, gdp), x); | 1060 | (unsigned long) i, ext4_free_inodes_count(sb, gdp), x); |
1060 | bitmap_count += x; | 1061 | bitmap_count += x; |