Whamcloud - gitweb
LU-4961 lustre: remove liblustre.h and obd.h from userspace
[fs/lustre-release.git] / lustre / utils / llog_reader.c
index 3c994fc..2a1903b 100644 (file)
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <endian.h>
 #include <fcntl.h>
 
 #include <time.h>
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
 #include <lustre/lustre_idl.h>
+#include <lustre_cfg.h>
+
+static inline int ext2_test_bit(int nr, const void *addr)
+{
+#if __BYTE_ORDER == __BIG_ENDIAN
+       const unsigned char *tmp = addr;
+       return (tmp[nr >> 3] >> (nr & 7)) & 1;
+#else
+       return test_bit(nr, addr);
+#endif
+}
 
 int llog_pack_buffer(int fd, struct llog_log_hdr **llog_buf,
                      struct llog_rec_hdr ***recs, int *recs_number);