#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <endian.h>
+#ifdef HAVE_ENDIAN_H
+# include <endian.h>
+#endif
#include <unistd.h>
#include <fcntl.h>
const unsigned char *tmp = addr;
return (tmp[nr >> 3] >> (nr & 7)) & 1;
#else
- return test_bit(nr, addr);
+ const unsigned long *tmp = addr;
+ return ((1UL << (nr & (BITS_PER_LONG - 1))) &
+ ((tmp)[nr / BITS_PER_LONG])) != 0;
#endif
}
cur_rec = (struct llog_rec_hdr *)ptr;
idx = le32_to_cpu(cur_rec->lrh_index);
- recs_pr[i] = cur_rec;
-
- if (ext2_test_bit(idx, (*llog)->llh_bitmap)) {
- if (le32_to_cpu(cur_rec->lrh_type) != OBD_CFG_REC)
- printf("rec #%d type=%x len=%u\n", idx,
- cur_rec->lrh_type, cur_rec->lrh_len);
- } else {
- printf("Bit %d of %d not set\n", idx, recs_num);
- cur_rec->lrh_id = CANCELLED;
- /* The header counts only set records */
- i--;
- }
+ recs_pr[i] = cur_rec;
+
+ if (ext2_test_bit(idx, LLOG_HDR_BITMAP(*llog))) {
+ if (le32_to_cpu(cur_rec->lrh_type) != OBD_CFG_REC)
+ printf("rec #%d type=%x len=%u\n", idx,
+ cur_rec->lrh_type, cur_rec->lrh_len);
+ } else {
+ printf("Bit %d of %d not set\n", idx, recs_num);
+ cur_rec->lrh_id = CANCELLED;
+ /* The header counts only set records */
+ i--;
+ }
ptr += le32_to_cpu(cur_rec->lrh_len);
if ((ptr - file_buf) > file_size) {