diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2011-07-25 20:13:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-25 23:57:17 -0400 |
commit | 9d6bf5aa177ee7ffdcee2a590ef8a1bf9e8ade87 (patch) | |
tree | 563a7b08688ba07ebdbdfc5e1d13ab89e2ed8062 /fs/reiserfs | |
parent | 0c2fd1bfb155947a821fdaeb3c46aa1cfa20ad64 (diff) |
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>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r-- | fs/reiserfs/bitmap.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c index 567385aa7813..d1aca1df4f92 100644 --- a/fs/reiserfs/bitmap.c +++ b/fs/reiserfs/bitmap.c | |||
@@ -1222,15 +1222,11 @@ void reiserfs_cache_bitmap_metadata(struct super_block *sb, | |||
1222 | info->free_count = 0; | 1222 | info->free_count = 0; |
1223 | 1223 | ||
1224 | while (--cur >= (unsigned long *)bh->b_data) { | 1224 | while (--cur >= (unsigned long *)bh->b_data) { |
1225 | int i; | ||
1226 | |||
1227 | /* 0 and ~0 are special, we can optimize for them */ | 1225 | /* 0 and ~0 are special, we can optimize for them */ |
1228 | if (*cur == 0) | 1226 | if (*cur == 0) |
1229 | info->free_count += BITS_PER_LONG; | 1227 | info->free_count += BITS_PER_LONG; |
1230 | else if (*cur != ~0L) /* A mix, investigate */ | 1228 | else if (*cur != ~0L) /* A mix, investigate */ |
1231 | for (i = BITS_PER_LONG - 1; i >= 0; i--) | 1229 | info->free_count += BITS_PER_LONG - hweight_long(*cur); |
1232 | if (!reiserfs_test_le_bit(i, cur)) | ||
1233 | info->free_count++; | ||
1234 | } | 1230 | } |
1235 | } | 1231 | } |
1236 | 1232 | ||