[PSDK]
[reactos.git] / reactos / drivers / filesystems / ext2 / inc / linux / ext4_jbd2.h
1 #ifndef _EXT4_JBD2_H
2 #define _EXT4_JBD2_H
3
4 /*
5 * Wrapper functions with which ext4 calls into JBD.
6 */
7 void ext4_journal_abort_handle(const char *caller, unsigned int line,
8 const char *err_fn, struct buffer_head *bh,
9 handle_t *handle, int err);
10
11 int __ext4_handle_dirty_super(const char *where, unsigned int line,
12 handle_t *handle, struct super_block *sb);
13
14 int __ext4_journal_get_write_access(const char *where, unsigned int line,
15 void *icb, handle_t *handle, struct buffer_head *bh);
16
17 int __ext4_forget(const char *where, unsigned int line, void *icb, handle_t *handle,
18 int is_metadata, struct inode *inode,
19 struct buffer_head *bh, ext4_fsblk_t blocknr);
20
21 int __ext4_journal_get_create_access(const char *where, unsigned int line,
22 void *icb, handle_t *handle, struct buffer_head *bh);
23
24 int __ext4_handle_dirty_metadata(const char *where, unsigned int line,
25 void *icb, handle_t *handle, struct inode *inode,
26 struct buffer_head *bh);
27
28 #define ext4_journal_get_write_access(handle, icb, bh) \
29 __ext4_journal_get_write_access("", __LINE__, (icb), (handle), (bh))
30 #define ext4_forget(handle, icb, is_metadata, inode, bh, block_nr) \
31 __ext4_forget("", __LINE__, (icb), (handle), (is_metadata), (inode), \
32 (bh), (block_nr))
33 #define ext4_journal_get_create_access(handle, icb, bh) \
34 __ext4_journal_get_create_access("", __LINE__, (icb), (handle), (bh))
35 #define ext4_handle_dirty_metadata(handle, icb, inode, bh) \
36 __ext4_handle_dirty_metadata("", __LINE__, (icb), (handle), (inode), \
37 (bh))
38
39 handle_t *__ext4_journal_start_sb(void *icb, struct super_block *sb, unsigned int line,
40 int type, int blocks, int rsv_blocks);
41 int __ext4_journal_stop(const char *where, unsigned int line, void *icb, handle_t *handle);
42
43 #define ext4_journal_start_sb(icb, sb, type, nblocks) \
44 __ext4_journal_start_sb((icb), (sb), __LINE__, (type), (nblocks), 0)
45
46 #define ext4_journal_start(icb, inode, type, nblocks) \
47 __ext4_journal_start((icb), (inode), __LINE__, (type), (nblocks), 0)
48
49 static inline handle_t *__ext4_journal_start(void *icb, struct inode *inode,
50 unsigned int line, int type,
51 int blocks, int rsv_blocks)
52 {
53 return __ext4_journal_start_sb(icb, inode->i_sb, line, type, blocks,
54 rsv_blocks);
55 }
56
57 #define ext4_journal_stop(icb, handle) \
58 __ext4_journal_stop("", __LINE__, (icb), (handle))
59
60 static inline int ext4_journal_extend(void *icb, handle_t *handle, int nblocks)
61 {
62 return 0;
63 }
64
65 #endif