From 1a3cffd0efd4847bf032dbab650673ec0697b2d7 Mon Sep 17 00:00:00 2001 From: walter Date: Fri, 21 Dec 2007 04:46:23 +0000 Subject: [PATCH] revert bz-14390 commit which is causing build failures on buffalo --- lustre/include/liblustre.h | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/lustre/include/liblustre.h b/lustre/include/liblustre.h index 98e4c12..4e80252 100644 --- a/lustre/include/liblustre.h +++ b/lustre/include/liblustre.h @@ -67,7 +67,6 @@ #include #include #include -#include /* definitions for liblustre */ @@ -193,6 +192,35 @@ typedef int (write_proc_t)(struct file *file, const char *buffer, * to allow the compiler to adjust the bit shifting accordingly */ +/* test if bit nr is set in bitmap addr; returns previous value of bit nr */ +static __inline__ int set_bit(int nr, long * addr) +{ + long mask; + + addr += nr / BITS_PER_LONG; + mask = 1UL << (nr & (BITS_PER_LONG - 1)); + nr = (mask & *addr) != 0; + *addr |= mask; + return nr; +} + +/* clear bit nr in bitmap addr; returns previous value of bit nr*/ +static __inline__ int clear_bit(int nr, long * addr) +{ + long mask; + + addr += nr / BITS_PER_LONG; + mask = 1UL << (nr & (BITS_PER_LONG - 1)); + nr = (mask & *addr) != 0; + *addr &= ~mask; + return nr; +} + +static __inline__ int test_bit(int nr, long * addr) +{ + return ((1UL << (nr & (BITS_PER_LONG - 1))) & ((addr)[nr / BITS_PER_LONG])) != 0; +} + static __inline__ int ext2_set_bit(int nr, void *addr) { return set_bit(nr, (long*)addr); -- 1.8.3.1