aboutsummaryrefslogtreecommitdiff
path: root/fs/ext4/bitmap.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2012-06-30 19:14:57 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-09 08:23:12 -0700
commit74c429a11be427b0f2a7f02e585dc49a148a0e82 (patch)
tree333dd974971bdb9c515e5f6ac7ff7b813c8eef02 /fs/ext4/bitmap.c
parent5f66feb6035d82c46c1a63f540366ad7748e0719 (diff)
ext4: pass a char * to ext4_count_free() instead of a buffer_head ptr
commit f6fb99cadcd44660c68e13f6eab28333653621e6 upstream. Make it possible for ext4_count_free to operate on buffers and not just data in buffer_heads. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/ext4/bitmap.c')
-rw-r--r--fs/ext4/bitmap.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/ext4/bitmap.c b/fs/ext4/bitmap.c
index b319721da26..7e86a6d28c6 100644
--- a/fs/ext4/bitmap.c
+++ b/fs/ext4/bitmap.c
@@ -15,15 +15,13 @@
static const int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};
-unsigned int ext4_count_free(struct buffer_head *map, unsigned int numchars)
+unsigned int ext4_count_free(char *bitmap, unsigned int numchars)
{
unsigned int i, sum = 0;
- if (!map)
- return 0;
for (i = 0; i < numchars; i++)
- sum += nibblemap[map->b_data[i] & 0xf] +
- nibblemap[(map->b_data[i] >> 4) & 0xf];
+ sum += nibblemap[bitmap[i] & 0xf] +
+ nibblemap[(bitmap[i] >> 4) & 0xf];
return sum;
}