blob: 6d35e553b54ca0d865e72fc7ac8b4ee7b0e43e29 [file] [log] [blame]
Theodore Ts'o3b5386d2000-08-14 14:25:19 +00001
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
15typedef int tid_t;
16typedef e2fsck_t kdev_t;
17typedef struct journal_s journal_t;
18
19struct 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
30struct inode {
31 e2fsck_t i_ctx;
32 ino_t i_ino;
33 struct ext2_inode i_ext2;
34};
35
Theodore Ts'o241f2242000-10-26 20:42:07 +000036struct 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
Theodore Ts'o3b5386d2000-08-14 14:25:19 +000056int bmap(struct inode *inode, int block);
57struct buffer_head *getblk(e2fsck_t ctx, blk_t blocknr, int blocksize);
58void ll_rw_block(int rw, int dummy, struct buffer_head *bh);
59void mark_buffer_dirty(struct buffer_head *bh, int dummy);
60void brelse(struct buffer_head *bh);
61int buffer_uptodate(struct buffer_head *bh);
62void 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)
Theodore Ts'o99a2cc92000-08-22 21:41:52 +000066
67extern e2fsck_t e2fsck_global_ctx; /* Try your very best not to use this! */
68
Theodore Ts'o3b5386d2000-08-14 14:25:19 +000069#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); \
Theodore Ts'o99a2cc92000-08-22 21:41:52 +000074 fatal_error(e2fsck_global_ctx, 0); \
Theodore Ts'o3b5386d2000-08-14 14:25:19 +000075 } } while (0)
76
77#endif /* _JFS_COMPAT_H */