2 * Interface between ext4 and JBD
7 int __ext4_journal_get_undo_access(const char *where
, handle_t
*handle
,
8 struct buffer_head
*bh
)
12 if (ext4_handle_valid(handle
)) {
13 err
= jbd2_journal_get_undo_access(handle
, bh
);
15 ext4_journal_abort_handle(where
, __func__
, bh
,
21 int __ext4_journal_get_write_access(const char *where
, handle_t
*handle
,
22 struct buffer_head
*bh
)
26 if (ext4_handle_valid(handle
)) {
27 err
= jbd2_journal_get_write_access(handle
, bh
);
29 ext4_journal_abort_handle(where
, __func__
, bh
,
35 int __ext4_journal_forget(const char *where
, handle_t
*handle
,
36 struct buffer_head
*bh
)
40 if (ext4_handle_valid(handle
)) {
41 err
= jbd2_journal_forget(handle
, bh
);
43 ext4_journal_abort_handle(where
, __func__
, bh
,
51 int __ext4_journal_revoke(const char *where
, handle_t
*handle
,
52 ext4_fsblk_t blocknr
, struct buffer_head
*bh
)
56 if (ext4_handle_valid(handle
)) {
57 err
= jbd2_journal_revoke(handle
, blocknr
, bh
);
59 ext4_journal_abort_handle(where
, __func__
, bh
,
67 int __ext4_journal_get_create_access(const char *where
,
68 handle_t
*handle
, struct buffer_head
*bh
)
72 if (ext4_handle_valid(handle
)) {
73 err
= jbd2_journal_get_create_access(handle
, bh
);
75 ext4_journal_abort_handle(where
, __func__
, bh
,
81 int __ext4_handle_dirty_metadata(const char *where
, handle_t
*handle
,
82 struct inode
*inode
, struct buffer_head
*bh
)
86 if (ext4_handle_valid(handle
)) {
87 err
= jbd2_journal_dirty_metadata(handle
, bh
);
89 ext4_journal_abort_handle(where
, __func__
, bh
,
93 mark_buffer_dirty_inode(bh
, inode
);
95 mark_buffer_dirty(bh
);
96 if (inode
&& inode_needs_sync(inode
)) {
97 sync_dirty_buffer(bh
);
98 if (buffer_req(bh
) && !buffer_uptodate(bh
)) {
99 ext4_error(inode
->i_sb
, __func__
,
100 "IO error syncing inode, "
101 "inode=%lu, block=%llu",
103 (unsigned long long) bh
->b_blocknr
);