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
21 unsigned long long b_blocknr
;
31 struct ext2_inode i_ext2
;
40 #define K_DEV_JOURNAL 2
42 typedef struct kdev_s
*kdev_t
;
44 #define lock_buffer(bh) do {} while(0)
45 #define unlock_buffer(bh) do {} while(0)
46 #define buffer_req(bh) 1
47 #define do_readahead(journal, start) do {} while(0)
49 extern e2fsck_t e2fsck_global_ctx
; /* Try your very best not to use this! */
55 #define kmem_cache_alloc(cache,flags) malloc((cache)->object_length)
56 #define kmem_cache_free(cache,obj) free(obj)
57 #define kmem_cache_create(name,len,a,b,c,d) do_cache_create(len)
58 #define kmem_cache_destroy(cache) do_cache_destroy(cache)
59 #define kmalloc(len,flags) malloc(len)
60 #define kfree(p) free(p)
62 #define cond_resched() do { } while (0)
64 typedef unsigned int __be32
;
70 * Now pull in the real linux/jfs.h definitions.
72 #include <ext2fs/kernel-jbd.h>
75 * We use the standard libext2fs portability tricks for inline
78 #ifdef NO_INLINE_FUNCS
79 extern lkmem_cache_t
* do_cache_create(int len
);
80 extern void do_cache_destroy(lkmem_cache_t
*cache
);
81 extern size_t journal_tag_bytes(journal_t
*journal
);
84 #if (defined(E2FSCK_INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS))
85 #ifdef E2FSCK_INCLUDE_INLINE_FUNCS
86 #if (__STDC_VERSION__ >= 199901L)
87 #define _INLINE_ extern inline
89 #define _INLINE_ inline
91 #else /* !E2FSCK_INCLUDE_INLINE FUNCS */
92 #if (__STDC_VERSION__ >= 199901L)
93 #define _INLINE_ inline
96 #define _INLINE_ extern __inline__
97 #else /* For Watcom C */
98 #define _INLINE_ extern inline
100 #endif /* __STDC_VERSION__ >= 199901L */
101 #endif /* E2FSCK_INCLUDE_INLINE_FUNCS */
104 _INLINE_ lkmem_cache_t
* do_cache_create(int len
)
106 lkmem_cache_t
*new_cache
;
107 new_cache
= malloc(sizeof(*new_cache
));
109 new_cache
->object_length
= len
;
113 _INLINE_
void do_cache_destroy(lkmem_cache_t
*cache
)
122 * Kernel compatibility functions are defined in journal.c
124 int journal_bmap(journal_t
*journal
, blk64_t block
, unsigned long long *phys
);
125 struct buffer_head
*getblk(kdev_t ctx
, blk64_t blocknr
, int blocksize
);
126 void sync_blockdev(kdev_t kdev
);
127 void ll_rw_block(int rw
, int dummy
, struct buffer_head
*bh
[]);
128 void mark_buffer_dirty(struct buffer_head
*bh
);
129 void mark_buffer_uptodate(struct buffer_head
*bh
, int val
);
130 void brelse(struct buffer_head
*bh
);
131 int buffer_uptodate(struct buffer_head
*bh
);
132 void wait_on_buffer(struct buffer_head
*bh
);
135 * Define newer 2.5 interfaces
137 #define __getblk(dev, blocknr, blocksize) getblk(dev, blocknr, blocksize)
138 #define set_buffer_uptodate(bh) mark_buffer_uptodate(bh, 1)