Whamcloud - gitweb
Fix really stupid typo.
[tools/e2fsprogs.git] / e2fsck / jfs_compat.h
1
2 #ifndef _JFS_COMPAT_H
3 #define _JFS_COMPAT_H
4
5 #include "e2fsck.h"
6 #include <errno.h>
7
8 #define printk printf
9 #define KERN_ERR ""
10 #define KERN_DEBUG ""
11
12 #define READ 0
13 #define WRITE 1
14
15 typedef int tid_t;
16 typedef e2fsck_t kdev_t;
17 typedef struct journal_s journal_t;
18
19 struct buffer_head {
20         char     b_data[8192];
21         e2fsck_t b_ctx;
22         io_channel b_io;
23         int      b_size;
24         blk_t    b_blocknr;
25         int      b_dirty;
26         int      b_uptodate;
27         int      b_err;
28 };
29
30 struct inode {
31         e2fsck_t i_ctx;
32         ino_t    i_ino;
33         struct ext2_inode i_ext2;
34 };
35
36 struct journal_s
37 {
38         unsigned long           j_flags;
39         int                     j_errno;
40         struct buffer_head *    j_sb_buffer;
41         struct journal_superblock_s *j_superblock;
42         unsigned long           j_head;
43         unsigned long           j_tail;
44         unsigned long           j_free;
45         unsigned long           j_first, j_last;
46         kdev_t                  j_dev;
47         int                     j_blocksize;
48         unsigned int            j_blk_offset;
49         unsigned int            j_maxlen;
50         struct inode *          j_inode;
51         tid_t                   j_tail_sequence;
52         tid_t                   j_transaction_sequence;
53         __u8                    j_uuid[16];
54 };
55
56 int bmap(struct inode *inode, int block);
57 struct buffer_head *getblk(e2fsck_t ctx, blk_t blocknr, int blocksize);
58 void ll_rw_block(int rw, int dummy, struct buffer_head *bh);
59 void mark_buffer_dirty(struct buffer_head *bh, int dummy);
60 void brelse(struct buffer_head *bh);
61 int buffer_uptodate(struct buffer_head *bh);
62 void wait_on_buffer(struct buffer_head *bh);
63 #define fsync_dev(dev) do {} while(0)
64 #define buffer_req(bh) 1
65 #define do_readahead(journal, start) do {} while(0)
66         
67 extern e2fsck_t e2fsck_global_ctx;  /* Try your very best not to use this! */
68
69 #define J_ASSERT(assert)                                                \
70         do { if (!(assert)) {                                           \
71                 printf ("Assertion failure in %s() at %s line %d: "     \
72                         "\"%s\"\n",                                     \
73                         __FUNCTION__, __FILE__, __LINE__, # assert);    \
74                 fatal_error(e2fsck_global_ctx, 0);                      \
75         } } while (0)
76
77 #endif /* _JFS_COMPAT_H */