diff options
Diffstat (limited to 'fs/ocfs2/journal.h')
-rw-r--r-- | fs/ocfs2/journal.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 08d1add14872..d4d14e9a3cea 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h | |||
@@ -27,7 +27,12 @@ | |||
27 | #define OCFS2_JOURNAL_H | 27 | #define OCFS2_JOURNAL_H |
28 | 28 | ||
29 | #include <linux/fs.h> | 29 | #include <linux/fs.h> |
30 | #include <linux/jbd.h> | 30 | #ifndef CONFIG_OCFS2_COMPAT_JBD |
31 | # include <linux/jbd2.h> | ||
32 | #else | ||
33 | # include <linux/jbd.h> | ||
34 | # include "ocfs2_jbd_compat.h" | ||
35 | #endif | ||
31 | 36 | ||
32 | enum ocfs2_journal_state { | 37 | enum ocfs2_journal_state { |
33 | OCFS2_JOURNAL_FREE = 0, | 38 | OCFS2_JOURNAL_FREE = 0, |
@@ -215,8 +220,8 @@ static inline void ocfs2_checkpoint_inode(struct inode *inode) | |||
215 | * buffer. Will have to call ocfs2_journal_dirty once | 220 | * buffer. Will have to call ocfs2_journal_dirty once |
216 | * we've actually dirtied it. Type is one of . or . | 221 | * we've actually dirtied it. Type is one of . or . |
217 | * ocfs2_journal_dirty - Mark a journalled buffer as having dirty data. | 222 | * ocfs2_journal_dirty - Mark a journalled buffer as having dirty data. |
218 | * ocfs2_journal_dirty_data - Indicate that a data buffer should go out before | 223 | * ocfs2_jbd2_file_inode - Mark an inode so that its data goes out before |
219 | * the current handle commits. | 224 | * the current handle commits. |
220 | */ | 225 | */ |
221 | 226 | ||
222 | /* You must always start_trans with a number of buffs > 0, but it's | 227 | /* You must always start_trans with a number of buffs > 0, but it's |
@@ -268,8 +273,10 @@ int ocfs2_journal_access(handle_t *handle, | |||
268 | */ | 273 | */ |
269 | int ocfs2_journal_dirty(handle_t *handle, | 274 | int ocfs2_journal_dirty(handle_t *handle, |
270 | struct buffer_head *bh); | 275 | struct buffer_head *bh); |
276 | #ifdef CONFIG_OCFS2_COMPAT_JBD | ||
271 | int ocfs2_journal_dirty_data(handle_t *handle, | 277 | int ocfs2_journal_dirty_data(handle_t *handle, |
272 | struct buffer_head *bh); | 278 | struct buffer_head *bh); |
279 | #endif | ||
273 | 280 | ||
274 | /* | 281 | /* |
275 | * Credit Macros: | 282 | * Credit Macros: |
@@ -430,4 +437,16 @@ static inline int ocfs2_calc_tree_trunc_credits(struct super_block *sb, | |||
430 | return credits; | 437 | return credits; |
431 | } | 438 | } |
432 | 439 | ||
440 | static inline int ocfs2_jbd2_file_inode(handle_t *handle, struct inode *inode) | ||
441 | { | ||
442 | return jbd2_journal_file_inode(handle, &OCFS2_I(inode)->ip_jinode); | ||
443 | } | ||
444 | |||
445 | static inline int ocfs2_begin_ordered_truncate(struct inode *inode, | ||
446 | loff_t new_size) | ||
447 | { | ||
448 | return jbd2_journal_begin_ordered_truncate(&OCFS2_I(inode)->ip_jinode, | ||
449 | new_size); | ||
450 | } | ||
451 | |||
433 | #endif /* OCFS2_JOURNAL_H */ | 452 | #endif /* OCFS2_JOURNAL_H */ |