projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a60139
)
ocfs2: use memweight()
author
Akinobu Mita
<
[email protected]
>
Mon, 30 Jul 2012 21:41:03 +0000
(14:41 -0700)
committer
Linus Torvalds
<
[email protected]
>
Tue, 31 Jul 2012 00:25:16 +0000
(17:25 -0700)
Use memweight to count the total number of bits set in memory area.
Signed-off-by: Akinobu Mita <
[email protected]
>
Cc: Mark Fasheh <
[email protected]
>
Cc: Joel Becker <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
fs/ocfs2/localalloc.c
patch
|
blob
|
history
diff --git
a/fs/ocfs2/localalloc.c
b/fs/ocfs2/localalloc.c
index 210c35237548be82f9d99966beb166cdd2ffc87d..a9f78c74d687ed5845587ac619081653f7e510b7 100644
(file)
--- a/
fs/ocfs2/localalloc.c
+++ b/
fs/ocfs2/localalloc.c
@@
-784,14
+784,10
@@
bail:
static u32 ocfs2_local_alloc_count_bits(struct ocfs2_dinode *alloc)
{
- int i;
- u8 *buffer;
- u32 count = 0;
+ u32 count;
struct ocfs2_local_alloc *la = OCFS2_LOCAL_ALLOC(alloc);
- buffer = la->la_bitmap;
- for (i = 0; i < le16_to_cpu(la->la_size); i++)
- count += hweight8(buffer[i]);
+ count = memweight(la->la_bitmap, le16_to_cpu(la->la_size));
trace_ocfs2_local_alloc_count_bits(count);
return count;