summaryrefslogtreecommitdiff
path: root/kerncompat.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-06-12 11:39:09 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-06-12 11:39:09 -0400
commit65a545ff84b1b066616724fea95747edc4130111 (patch)
tree87453e4914cbe06eb45b451d49951544675eaf41 /kerncompat.h
parentd9f1317c7d927d3d0fc0b99762690438cafa0ead (diff)
downloadbtrfs-progs-65a545ff84b1b066616724fea95747edc4130111.tar.gz
i386 fixes from axboe
Diffstat (limited to 'kerncompat.h')
-rw-r--r--kerncompat.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/kerncompat.h b/kerncompat.h
index abad58c..8686012 100644
--- a/kerncompat.h
+++ b/kerncompat.h
@@ -71,8 +71,8 @@ struct page {
unsigned long index;
};
-static inline void preempt_enable(void) { do {; } while(0);}
-static inline void preempt_disable(void) { do {; } while(0);}
+#define preempt_enable() do { } while (0)
+#define preempt_disable() do { } while (0)
#define BITOP_MASK(nr) (1UL << ((nr) % BITS_PER_LONG))
#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
@@ -114,9 +114,16 @@ static inline int test_bit(int nr, const volatile unsigned long *addr)
#define BUG_ON(c) do { if (c) abort(); } while (0)
+#undef offsetof
+#ifdef __compiler_offsetof
+#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
+#else
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
#define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - __builtin_offsetof(type,member) );})
+ (type *)( (char *)__mptr - offsetof(type,member) );})
#define ENOMEM 5
#define EEXIST 6