diff options
Diffstat (limited to 'fs/ext4/bitmap.c')
-rw-r--r-- | fs/ext4/bitmap.c | 8 |
1 files changed, 3 insertions, 5 deletions
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 | ||