« Previous | Next » 

Revision 8cffde73


Added by Michael Tokarev about 12 years ago

get rid of private bitmap functions in block/sheepdog.c, use generic ones

qemu now has generic bitmap functions,
so don't redefine them in sheepdog.c,
use common header instead. A small cleanup.

Here's only one function which is actually
used in sheepdog and gets replaced with
a generic one (simplified):

- static inline int test_bit(int nr, const volatile unsigned long *addr)
+ static inline int test_bit(int nr, const unsigned long *addr) {
- return ((1UL << (nr % BITS_PER_LONG))
& ((unsigned long*)addr)[nr / BITS_PER_LONG])) != 0;
+ return 1UL & (addr[nr / BITS_PER_LONG] >> (nr & (BITS_PER_LONG-1)));

The body is equivalent, but the argument is not: there's
"volatile" in there. Why it is used for - I'm not sure.

Signed-off-by: Michael Tokarev <>
Acked-by: MORITA Kazutaka <>
Signed-off-by: Aurelien Jarno <>


  • added
  • modified
  • copied
  • renamed
  • deleted

View differences