Skip to content

Commit 9d6bf5a

Browse files
mitatorvalds
authored andcommitted
reiserfs: use hweight_long()
Use hweight_long() to count free bits in the bitmap. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 0c2fd1b commit 9d6bf5a

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎fs/reiserfs/bitmap.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,15 +1222,11 @@ void reiserfs_cache_bitmap_metadata(struct super_block *sb,
12221222
info->free_count = 0;
12231223

12241224
while (--cur >= (unsigned long *)bh->b_data) {
1225-
int i;
1226-
12271225
/* 0 and ~0 are special, we can optimize for them */
12281226
if (*cur == 0)
12291227
info->free_count += BITS_PER_LONG;
12301228
else if (*cur != ~0L) /* A mix, investigate */
1231-
for (i = BITS_PER_LONG - 1; i >= 0; i--)
1232-
if (!reiserfs_test_le_bit(i, cur))
1233-
info->free_count++;
1229+
info->free_count += BITS_PER_LONG - hweight_long(*cur);
12341230
}
12351231
}
12361232

0 commit comments

Comments
 (0)