aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/bitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/bitmap.c')
-rw-r--r--fs/ext4/bitmap.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/ext4/bitmap.c b/fs/ext4/bitmap.c
index b319721da26a..a94b9c63ee5c 100644
--- a/fs/ext4/bitmap.c
+++ b/fs/ext4/bitmap.c
@@ -11,24 +11,18 @@
11#include <linux/jbd2.h> 11#include <linux/jbd2.h>
12#include "ext4.h" 12#include "ext4.h"
13 13
14#ifdef EXT4FS_DEBUG
15
16static const int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0}; 14static const int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};
17 15
18unsigned int ext4_count_free(struct buffer_head *map, unsigned int numchars) 16unsigned int ext4_count_free(char *bitmap, unsigned int numchars)
19{ 17{
20 unsigned int i, sum = 0; 18 unsigned int i, sum = 0;
21 19
22 if (!map)
23 return 0;
24 for (i = 0; i < numchars; i++) 20 for (i = 0; i < numchars; i++)
25 sum += nibblemap[map->b_data[i] & 0xf] + 21 sum += nibblemap[bitmap[i] & 0xf] +
26 nibblemap[(map->b_data[i] >> 4) & 0xf]; 22 nibblemap[(bitmap[i] >> 4) & 0xf];
27 return sum; 23 return sum;
28} 24}
29 25
30#endif /* EXT4FS_DEBUG */
31
32int ext4_inode_bitmap_csum_verify(struct super_block *sb, ext4_group_t group, 26int ext4_inode_bitmap_csum_verify(struct super_block *sb, ext4_group_t group,
33 struct ext4_group_desc *gdp, 27 struct ext4_group_desc *gdp,
34 struct buffer_head *bh, int sz) 28 struct buffer_head *bh, int sz)