2 * Compatibility header file for e2fsck which should be included
3 * instead of linux/jfs.h
5 * Copyright (C) 2000 Stephen C. Tweedie
7 * This file may be redistributed under the terms of the
8 * GNU General Public License version 2 or at your discretion
13 * Pull in the definition of the e2fsck context structure
31 struct ext2_inode i_ext2;
34 typedef e2fsck_t kdev_t;
37 * Kernel compatibility functions are defined in journal.c
39 int bmap(struct inode *inode, int block);
40 struct buffer_head *getblk(e2fsck_t ctx, blk_t blocknr, int blocksize);
41 void ll_rw_block(int rw, int dummy, struct buffer_head *bh[]);
42 void mark_buffer_dirty(struct buffer_head *bh, int dummy);
43 void mark_buffer_uptodate(struct buffer_head *bh, int val);
44 void brelse(struct buffer_head *bh);
45 int buffer_uptodate(struct buffer_head *bh);
46 void wait_on_buffer(struct buffer_head *bh);
47 #define fsync_dev(dev) do {} while(0)
48 #define buffer_req(bh) 1
49 #define do_readahead(journal, start) do {} while(0)
51 extern e2fsck_t e2fsck_global_ctx; /* Try your very best not to use this! */
57 #define kmem_cache_alloc(cache,flags) malloc((cache)->object_length)
58 #define kmem_cache_free(cache,obj) free(obj)
59 #define kmem_cache_create(name,len,a,b,c,d) do_cache_create(len)
60 #define kmalloc(len,flags) malloc(len)
61 #define kfree(p) free(p)
64 * We use the standard libext2fs portability tricks for inline
67 extern kmem_cache_t * do_cache_create(int len);
69 #if (defined(E2FSCK_INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS))
70 #ifdef E2FSCK_INCLUDE_INLINE_FUNCS
71 #define _INLINE_ extern
74 #define _INLINE_ extern __inline__
75 #else /* For Watcom C */
76 #define _INLINE_ extern inline
80 _INLINE_ kmem_cache_t * do_cache_create(int len)
82 kmem_cache_t *new_cache;
83 new_cache = malloc(sizeof(*new_cache));
85 new_cache->object_length = len;
93 * Now pull in the real linux/jfs.h definitions.
95 #include <linux/jfs.h>