diff options
Diffstat (limited to 'fs/ext2/balloc.c')
-rw-r--r-- | fs/ext2/balloc.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index 1c3613998862..376aa77f3ca7 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 | ||
1447 | static const int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0}; | 1447 | unsigned long ext2_count_free(struct buffer_head *map, unsigned int numchars) |
1448 | |||
1449 | unsigned 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 */ |