All of lore.kernel.org
 help / color / mirror / Atom feed
* how to understand this bitmap_zero
@ 2005-11-09 17:28 Ming Zhang
  2005-11-09 22:29 ` Neil Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Ming Zhang @ 2005-11-09 17:28 UTC (permalink / raw)
  To: linux-raid

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-11-10  2:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-09 17:28 how to understand this bitmap_zero Ming Zhang
2005-11-09 22:29 ` Neil Brown
2005-11-09 23:11   ` Ming Zhang
2005-11-10  2:20     ` Neil Brown

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.