From: Jan Kara <jack@suse.cz>
To: Akinobu Mita <akinobu.mita@gmail.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2 02/10] minixfs: use memweight()
Date: Mon, 4 Jun 2012 12:26:23 +0200 [thread overview]
Message-ID: <20120604102623.GE7670@quack.suse.cz> (raw)
In-Reply-To: <1338644416-11417-2-git-send-email-akinobu.mita@gmail.com>
On Sat 02-06-12 22:40:08, Akinobu Mita wrote:
> Use memweight() to count the total number of bits clear in memory area.
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: linux-fsdevel@vger.kernel.org
> ---
>
> No changes from v1
>
> fs/minix/bitmap.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/minix/bitmap.c b/fs/minix/bitmap.c
> index 4bc50da..564f1a5 100644
> --- a/fs/minix/bitmap.c
> +++ b/fs/minix/bitmap.c
> @@ -29,10 +29,8 @@ static __u32 count_free(struct buffer_head *map[], unsigned blocksize, __u32 num
> unsigned blocks = DIV_ROUND_UP(numbits, blocksize * 8);
>
> while (blocks--) {
> - unsigned words = blocksize / 2;
> - __u16 *p = (__u16 *)(*map++)->b_data;
> - while (words--)
> - sum += 16 - hweight16(*p++);
> + sum += blocksize * BITS_PER_BYTE -
> + memweight((*map++)->b_data, blocksize);
Hmm, just using bitmap_weight() should be fine here as well AFAICS...
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2012-06-04 10:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-02 13:40 [PATCH v2 01/10] string: introduce memweight Akinobu Mita
2012-06-02 13:40 ` [PATCH v2 02/10] minixfs: use memweight() Akinobu Mita
2012-06-04 10:26 ` Jan Kara [this message]
2012-06-02 13:40 ` [PATCH v2 05/10] affs: " Akinobu Mita
2012-06-04 10:12 ` [PATCH v2 01/10] string: introduce memweight Jan Kara
2012-06-04 11:46 ` Akinobu Mita
2012-06-04 13:35 ` Jan Kara
2012-06-05 9:03 ` Akinobu Mita
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120604102623.GE7670@quack.suse.cz \
--to=jack@suse.cz \
--cc=akinobu.mita@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).