From 7d70b06843b4d992f09221b3709d677657f7c8eb Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Mon, 30 Jul 2012 14:41:03 -0700 Subject: [PATCH] --- yaml --- r: 319929 b: refs/heads/master c: a75613ec73ec87726a81fe421385a13c25fdcfc4 h: refs/heads/master i: 319927: f5d11dbe4924a364e3e52897b45982390bdc084b v: v3 --- [refs] | 2 +- trunk/fs/ocfs2/localalloc.c | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index c48956025f91..2a9fe3897c93 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9a601396e8681d9884a9f429cba7ceb2b2a4d21c +refs/heads/master: a75613ec73ec87726a81fe421385a13c25fdcfc4 diff --git a/trunk/fs/ocfs2/localalloc.c b/trunk/fs/ocfs2/localalloc.c index 210c35237548..a9f78c74d687 100644 --- a/trunk/fs/ocfs2/localalloc.c +++ b/trunk/fs/ocfs2/localalloc.c @@ -784,14 +784,10 @@ int ocfs2_claim_local_alloc_bits(struct ocfs2_super *osb, 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;