• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
21 typedef unsigned int tid_t;
22 typedef struct journal_s journal_t;
23 
24 struct buffer_head;
25 struct inode;
26 
27 struct journal_s
28 {
29 	unsigned long		j_flags;
30 	int			j_errno;
31 	struct buffer_head *	j_sb_buffer;
32 	struct journal_superblock_s *j_superblock;
33 	int			j_format_version;
34 	unsigned long		j_head;
35 	unsigned long		j_tail;
36 	unsigned long		j_free;
37 	unsigned long		j_first, j_last;
38 	kdev_t			j_dev;
39 	kdev_t			j_fs_dev;
40 	int			j_blocksize;
41 	unsigned int		j_blk_offset;
42 	unsigned int		j_maxlen;
43 	struct inode *		j_inode;
44 	tid_t			j_tail_sequence;
45 	tid_t			j_transaction_sequence;
46 	__u8			j_uuid[16];
47 	struct jbd_revoke_table_s *j_revoke;
48 	tid_t			j_failed_commit;
49 };
50 
51 #define J_ASSERT(assert)						\
52 	do { if (!(assert)) {						\
53 		printf ("Assertion failure in %s() at %s line %d: "	\
54 			"\"%s\"\n",					\
55 			__FUNCTION__, __FILE__, __LINE__, # assert);	\
56 		fatal_error(e2fsck_global_ctx, 0);			\
57 	} } while (0)
58 
59 #define is_journal_abort(x) 0
60 
61 #define BUFFER_TRACE(bh, info)	do {} while (0)
62 
63 /* Need this so we can compile with configure --enable-gcc-wall */
64 #ifdef NO_INLINE_FUNCS
65 #define inline
66 #endif
67 
68 #endif /* _JFS_COMPAT_H */
69