Andrew Morton | 8984d13 | 2006-12-06 20:37:15 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Interface between ext4 and JBD |
| 3 | */ |
| 4 | |
Christoph Hellwig | 3dcf545 | 2008-04-29 18:13:32 -0400 | [diff] [blame] | 5 | #include "ext4_jbd2.h" |
Andrew Morton | 8984d13 | 2006-12-06 20:37:15 -0800 | [diff] [blame] | 6 | |
| 7 | int __ext4_journal_get_undo_access(const char *where, handle_t *handle, |
| 8 | struct buffer_head *bh) |
| 9 | { |
| 10 | int err = jbd2_journal_get_undo_access(handle, bh); |
| 11 | if (err) |
Harvey Harrison | 46e665e | 2008-04-17 10:38:59 -0400 | [diff] [blame] | 12 | ext4_journal_abort_handle(where, __func__, bh, handle, err); |
Andrew Morton | 8984d13 | 2006-12-06 20:37:15 -0800 | [diff] [blame] | 13 | return err; |
| 14 | } |
| 15 | |
| 16 | int __ext4_journal_get_write_access(const char *where, handle_t *handle, |
| 17 | struct buffer_head *bh) |
| 18 | { |
| 19 | int err = jbd2_journal_get_write_access(handle, bh); |
| 20 | if (err) |
Harvey Harrison | 46e665e | 2008-04-17 10:38:59 -0400 | [diff] [blame] | 21 | ext4_journal_abort_handle(where, __func__, bh, handle, err); |
Andrew Morton | 8984d13 | 2006-12-06 20:37:15 -0800 | [diff] [blame] | 22 | return err; |
| 23 | } |
| 24 | |
| 25 | int __ext4_journal_forget(const char *where, handle_t *handle, |
| 26 | struct buffer_head *bh) |
| 27 | { |
| 28 | int err = jbd2_journal_forget(handle, bh); |
| 29 | if (err) |
Harvey Harrison | 46e665e | 2008-04-17 10:38:59 -0400 | [diff] [blame] | 30 | ext4_journal_abort_handle(where, __func__, bh, handle, err); |
Andrew Morton | 8984d13 | 2006-12-06 20:37:15 -0800 | [diff] [blame] | 31 | return err; |
| 32 | } |
| 33 | |
| 34 | int __ext4_journal_revoke(const char *where, handle_t *handle, |
| 35 | ext4_fsblk_t blocknr, struct buffer_head *bh) |
| 36 | { |
| 37 | int err = jbd2_journal_revoke(handle, blocknr, bh); |
| 38 | if (err) |
Harvey Harrison | 46e665e | 2008-04-17 10:38:59 -0400 | [diff] [blame] | 39 | ext4_journal_abort_handle(where, __func__, bh, handle, err); |
Andrew Morton | 8984d13 | 2006-12-06 20:37:15 -0800 | [diff] [blame] | 40 | return err; |
| 41 | } |
| 42 | |
| 43 | int __ext4_journal_get_create_access(const char *where, |
| 44 | handle_t *handle, struct buffer_head *bh) |
| 45 | { |
| 46 | int err = jbd2_journal_get_create_access(handle, bh); |
| 47 | if (err) |
Harvey Harrison | 46e665e | 2008-04-17 10:38:59 -0400 | [diff] [blame] | 48 | ext4_journal_abort_handle(where, __func__, bh, handle, err); |
Andrew Morton | 8984d13 | 2006-12-06 20:37:15 -0800 | [diff] [blame] | 49 | return err; |
| 50 | } |
| 51 | |
| 52 | int __ext4_journal_dirty_metadata(const char *where, |
| 53 | handle_t *handle, struct buffer_head *bh) |
| 54 | { |
| 55 | int err = jbd2_journal_dirty_metadata(handle, bh); |
| 56 | if (err) |
Harvey Harrison | 46e665e | 2008-04-17 10:38:59 -0400 | [diff] [blame] | 57 | ext4_journal_abort_handle(where, __func__, bh, handle, err); |
Andrew Morton | 8984d13 | 2006-12-06 20:37:15 -0800 | [diff] [blame] | 58 | return err; |
| 59 | } |