diff options
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/localalloc.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c index 210c35237548..a9f78c74d687 100644 --- a/fs/ocfs2/localalloc.c +++ b/fs/ocfs2/localalloc.c | |||
@@ -784,14 +784,10 @@ bail: | |||
784 | 784 | ||
785 | static u32 ocfs2_local_alloc_count_bits(struct ocfs2_dinode *alloc) | 785 | static u32 ocfs2_local_alloc_count_bits(struct ocfs2_dinode *alloc) |
786 | { | 786 | { |
787 | int i; | 787 | u32 count; |
788 | u8 *buffer; | ||
789 | u32 count = 0; | ||
790 | struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); | 788 | struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc); |
791 | 789 | ||
792 | buffer = la->la_bitmap; | 790 | count = memweight(la->la_bitmap, le16_to_cpu(la->la_size)); |
793 | for (i = 0; i < le16_to_cpu(la->la_size); i++) | ||
794 | count += hweight8(buffer[i]); | ||
795 | 791 | ||
796 | trace_ocfs2_local_alloc_count_bits(count); | 792 | trace_ocfs2_local_alloc_count_bits(count); |
797 | return count; | 793 | return count; |