From: Ming Zhang <mingz@ele.uri.edu>
To: linux-raid@vger.kernel.org
Subject: how to understand this bitmap_zero
Date: Wed, 09 Nov 2005 12:28:57 -0500 [thread overview]
Message-ID: <1131557337.8969.466.camel@localhost.localdomain> (raw)
could anybody help me on this? thanks!
see if we call bitmap_zero(dst, 2), it will do *dst = 0UL and thus clear
whole *dst, but what if we intent to clear 2 bits? not 32bits?
static inline void bitmap_zero(unsigned long *dst, int nbits)
{
if (nbits <= BITS_PER_LONG)
*dst = 0UL;
else {
int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
memset(dst, 0, len);
}
}
Ming
next reply other threads:[~2005-11-09 17:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-09 17:28 Ming Zhang [this message]
2005-11-09 22:29 ` how to understand this bitmap_zero Neil Brown
2005-11-09 23:11 ` Ming Zhang
2005-11-10 2:20 ` Neil Brown
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=1131557337.8969.466.camel@localhost.localdomain \
--to=mingz@ele.uri.edu \
--cc=linux-raid@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.