Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / include / liblustre.h
index 09bf725..5d357c7 100644 (file)
@@ -86,17 +86,30 @@ void *inter_module_get(char *arg);
 
 static __inline__ int ext2_set_bit(int nr, void *addr)
 {
+#ifdef __BIG_ENDIAN
+        return set_bit((nr ^ ((BITS_PER_LONG-1) & ~0x7)), addr);
+#else
         return set_bit(nr, addr);
+#endif
 }
 
 static __inline__ int ext2_clear_bit(int nr, void *addr)
 {
+#ifdef __BIG_ENDIAN
+        return clear_bit((nr ^ ((BITS_PER_LONG-1) & ~0x7)), addr);
+#else
         return clear_bit(nr, addr);
+#endif
 }
 
 static __inline__ int ext2_test_bit(int nr, void *addr)
 {
+#ifdef __BIG_ENDIAN
+        __const__ unsigned char *tmp = (__const__ unsigned char *) addr;
+        return (tmp[nr >> 3] >> (nr & 7)) & 1;
+#else
         return test_bit(nr, addr);
+#endif
 }
 
 
@@ -342,6 +355,10 @@ int test_and_clear_bit(int nr, unsigned long *addr)
         return oldbit;
 }
 
+#define libcfs_memory_pressure_get() (0) 
+#define libcfs_memory_pressure_put() do {} while (0) 
+#define libcfs_memory_pressure_clr() do {} while (0)
+
 /* FIXME sys/capability will finally included linux/fs.h thus
  * cause numerous trouble on x86-64. as temporary solution for
  * build broken at Cray, we copy definition we need from capability.h