Whamcloud - gitweb
Merge branch 'maint' into next
[tools/e2fsprogs.git] / lib / ext2fs / jfs_compat.h
1
2 #ifndef _JFS_COMPAT_H
3 #define _JFS_COMPAT_H
4
5 #include "kernel-list.h"
6 #include <errno.h>
7 #ifdef HAVE_NETINET_IN_H
8 #include <netinet/in.h>
9 #endif
10
11 #define printk printf
12 #define KERN_ERR ""
13 #define KERN_DEBUG ""
14
15 #define READ 0
16 #define WRITE 1
17
18 #define cpu_to_be32(n) htonl(n)
19 #define be32_to_cpu(n) ntohl(n)
20 #define cpu_to_be16(n) htons(n)
21 #define be16_to_cpu(n) ntohs(n)
22
23 typedef unsigned int tid_t;
24 typedef struct journal_s journal_t;
25
26 struct buffer_head;
27 struct inode;
28
29 struct journal_s
30 {
31         unsigned long           j_flags;
32         int                     j_errno;
33         struct buffer_head *    j_sb_buffer;
34         struct journal_superblock_s *j_superblock;
35         int                     j_format_version;
36         unsigned long           j_head;
37         unsigned long           j_tail;
38         unsigned long           j_free;
39         unsigned long           j_first, j_last;
40         kdev_t                  j_dev;
41         kdev_t                  j_fs_dev;
42         int                     j_blocksize;
43         unsigned int            j_blk_offset;
44         unsigned int            j_maxlen;
45         struct inode *          j_inode;
46         tid_t                   j_tail_sequence;
47         tid_t                   j_transaction_sequence;
48         __u8                    j_uuid[16];
49         struct jbd_revoke_table_s *j_revoke;
50         tid_t                   j_failed_commit;
51 };
52
53 #define J_ASSERT(assert)                                                \
54         do { if (!(assert)) {                                           \
55                 printf ("Assertion failure in %s() at %s line %d: "     \
56                         "\"%s\"\n",                                     \
57                         __FUNCTION__, __FILE__, __LINE__, # assert);    \
58                 fatal_error(e2fsck_global_ctx, 0);                      \
59         } } while (0)
60
61 #define is_journal_abort(x) 0
62
63 #define BUFFER_TRACE(bh, info)  do {} while (0)
64
65 /* Need this so we can compile with configure --enable-gcc-wall */
66 #ifdef NO_INLINE_FUNCS
67 #define inline
68 #endif
69
70 #endif /* _JFS_COMPAT_H */