]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/reiserfs/bitmap.c
reiserfs: use hweight_long()
[mirror_ubuntu-artful-kernel.git] / fs / reiserfs / bitmap.c
index 483442e66ed6d2066869fa770ec63c6808a3b283..d1aca1df4f9208ec706d1b7228b68ae32c17ce96 100644 (file)
@@ -214,7 +214,7 @@ static int scan_bitmap_block(struct reiserfs_transaction_handle *th,
                                        }
                                        /* otherwise we clear all bit were set ... */
                                        while (--i >= *beg)
-                                               reiserfs_test_and_clear_le_bit
+                                               reiserfs_clear_le_bit
                                                    (i, bh->b_data);
                                        reiserfs_restore_prepared_buffer(s, bh);
                                        *beg = org;
@@ -1222,15 +1222,11 @@ void reiserfs_cache_bitmap_metadata(struct super_block *sb,
        info->free_count = 0;
 
        while (--cur >= (unsigned long *)bh->b_data) {
-               int i;
-
                /* 0 and ~0 are special, we can optimize for them */
                if (*cur == 0)
                        info->free_count += BITS_PER_LONG;
                else if (*cur != ~0L)   /* A mix, investigate */
-                       for (i = BITS_PER_LONG - 1; i >= 0; i--)
-                               if (!reiserfs_test_le_bit(i, cur))
-                                       info->free_count++;
+                       info->free_count += BITS_PER_LONG - hweight_long(*cur);
        }
 }