aboutsummaryrefslogtreecommitdiff
path: root/osdep.h
diff options
context:
space:
mode:
authorMichael Tokarev <mjt@tls.msk.ru>2011-03-10 17:03:41 +0300
committerAurelien Jarno <aurelien@aurel32.net>2011-04-01 22:23:06 +0200
commit8cffde7329734c17ee2eeec84944abbf4a0f23f3 (patch)
tree4a9b6725f77e9d77ab4516f53ac49cada921e167 /osdep.h
parent508240c0daecdd62ab46727f37145f2dbb029ff7 (diff)
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 <mjt@tls.msk.ru> Acked-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'osdep.h')
0 files changed, 0 insertions, 0 deletions