diff options
Diffstat (limited to 'fs/ext4/ext4_jbd2.h')
-rw-r--r-- | fs/ext4/ext4_jbd2.h | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/fs/ext4/ext4_jbd2.h b/fs/ext4/ext4_jbd2.h index dade0c024797..b0bd792c58c5 100644 --- a/fs/ext4/ext4_jbd2.h +++ b/fs/ext4/ext4_jbd2.h | |||
@@ -122,39 +122,47 @@ int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode); | |||
122 | /* | 122 | /* |
123 | * Wrapper functions with which ext4 calls into JBD. | 123 | * Wrapper functions with which ext4 calls into JBD. |
124 | */ | 124 | */ |
125 | void ext4_journal_abort_handle(const char *caller, const char *err_fn, | 125 | void ext4_journal_abort_handle(const char *caller, unsigned int line, |
126 | const char *err_fn, | ||
126 | struct buffer_head *bh, handle_t *handle, int err); | 127 | struct buffer_head *bh, handle_t *handle, int err); |
127 | 128 | ||
128 | int __ext4_journal_get_undo_access(const char *where, handle_t *handle, | 129 | int __ext4_journal_get_undo_access(const char *where, unsigned int line, |
129 | struct buffer_head *bh); | 130 | handle_t *handle, struct buffer_head *bh); |
130 | 131 | ||
131 | int __ext4_journal_get_write_access(const char *where, handle_t *handle, | 132 | int __ext4_journal_get_write_access(const char *where, unsigned int line, |
132 | struct buffer_head *bh); | 133 | handle_t *handle, struct buffer_head *bh); |
133 | 134 | ||
134 | int __ext4_forget(const char *where, handle_t *handle, int is_metadata, | 135 | int __ext4_forget(const char *where, unsigned int line, handle_t *handle, |
135 | struct inode *inode, struct buffer_head *bh, | 136 | int is_metadata, struct inode *inode, |
136 | ext4_fsblk_t blocknr); | 137 | struct buffer_head *bh, ext4_fsblk_t blocknr); |
137 | 138 | ||
138 | int __ext4_journal_get_create_access(const char *where, | 139 | int __ext4_journal_get_create_access(const char *where, unsigned int line, |
139 | handle_t *handle, struct buffer_head *bh); | 140 | handle_t *handle, struct buffer_head *bh); |
140 | 141 | ||
141 | int __ext4_handle_dirty_metadata(const char *where, handle_t *handle, | 142 | int __ext4_handle_dirty_metadata(const char *where, unsigned int line, |
142 | struct inode *inode, struct buffer_head *bh); | 143 | handle_t *handle, struct inode *inode, |
144 | struct buffer_head *bh); | ||
145 | |||
146 | int __ext4_handle_dirty_super(const char *where, unsigned int line, | ||
147 | handle_t *handle, struct super_block *sb); | ||
143 | 148 | ||
144 | #define ext4_journal_get_undo_access(handle, bh) \ | 149 | #define ext4_journal_get_undo_access(handle, bh) \ |
145 | __ext4_journal_get_undo_access(__func__, (handle), (bh)) | 150 | __ext4_journal_get_undo_access(__func__, __LINE__, (handle), (bh)) |
146 | #define ext4_journal_get_write_access(handle, bh) \ | 151 | #define ext4_journal_get_write_access(handle, bh) \ |
147 | __ext4_journal_get_write_access(__func__, (handle), (bh)) | 152 | __ext4_journal_get_write_access(__func__, __LINE__, (handle), (bh)) |
148 | #define ext4_forget(handle, is_metadata, inode, bh, block_nr) \ | 153 | #define ext4_forget(handle, is_metadata, inode, bh, block_nr) \ |
149 | __ext4_forget(__func__, (handle), (is_metadata), (inode), (bh),\ | 154 | __ext4_forget(__func__, __LINE__, (handle), (is_metadata), (inode), \ |
150 | (block_nr)) | 155 | (bh), (block_nr)) |
151 | #define ext4_journal_get_create_access(handle, bh) \ | 156 | #define ext4_journal_get_create_access(handle, bh) \ |
152 | __ext4_journal_get_create_access(__func__, (handle), (bh)) | 157 | __ext4_journal_get_create_access(__func__, __LINE__, (handle), (bh)) |
153 | #define ext4_handle_dirty_metadata(handle, inode, bh) \ | 158 | #define ext4_handle_dirty_metadata(handle, inode, bh) \ |
154 | __ext4_handle_dirty_metadata(__func__, (handle), (inode), (bh)) | 159 | __ext4_handle_dirty_metadata(__func__, __LINE__, (handle), (inode), \ |
160 | (bh)) | ||
161 | #define ext4_handle_dirty_super(handle, sb) \ | ||
162 | __ext4_handle_dirty_super(__func__, __LINE__, (handle), (sb)) | ||
155 | 163 | ||
156 | handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks); | 164 | handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks); |
157 | int __ext4_journal_stop(const char *where, handle_t *handle); | 165 | int __ext4_journal_stop(const char *where, unsigned int line, handle_t *handle); |
158 | 166 | ||
159 | #define EXT4_NOJOURNAL_MAX_REF_COUNT ((unsigned long) 4096) | 167 | #define EXT4_NOJOURNAL_MAX_REF_COUNT ((unsigned long) 4096) |
160 | 168 | ||
@@ -207,7 +215,7 @@ static inline handle_t *ext4_journal_start(struct inode *inode, int nblocks) | |||
207 | } | 215 | } |
208 | 216 | ||
209 | #define ext4_journal_stop(handle) \ | 217 | #define ext4_journal_stop(handle) \ |
210 | __ext4_journal_stop(__func__, (handle)) | 218 | __ext4_journal_stop(__func__, __LINE__, (handle)) |
211 | 219 | ||
212 | static inline handle_t *ext4_journal_current_handle(void) | 220 | static inline handle_t *ext4_journal_current_handle(void) |
213 | { | 221 | { |
@@ -308,17 +316,15 @@ static inline int ext4_should_writeback_data(struct inode *inode) | |||
308 | * This function controls whether or not we should try to go down the | 316 | * This function controls whether or not we should try to go down the |
309 | * dioread_nolock code paths, which makes it safe to avoid taking | 317 | * dioread_nolock code paths, which makes it safe to avoid taking |
310 | * i_mutex for direct I/O reads. This only works for extent-based | 318 | * i_mutex for direct I/O reads. This only works for extent-based |
311 | * files, and it doesn't work for nobh or if data journaling is | 319 | * files, and it doesn't work if data journaling is enabled, since the |
312 | * enabled, since the dioread_nolock code uses b_private to pass | 320 | * dioread_nolock code uses b_private to pass information back to the |
313 | * information back to the I/O completion handler, and this conflicts | 321 | * I/O completion handler, and this conflicts with the jbd's use of |
314 | * with the jbd's use of b_private. | 322 | * b_private. |
315 | */ | 323 | */ |
316 | static inline int ext4_should_dioread_nolock(struct inode *inode) | 324 | static inline int ext4_should_dioread_nolock(struct inode *inode) |
317 | { | 325 | { |
318 | if (!test_opt(inode->i_sb, DIOREAD_NOLOCK)) | 326 | if (!test_opt(inode->i_sb, DIOREAD_NOLOCK)) |
319 | return 0; | 327 | return 0; |
320 | if (test_opt(inode->i_sb, NOBH)) | ||
321 | return 0; | ||
322 | if (!S_ISREG(inode->i_mode)) | 328 | if (!S_ISREG(inode->i_mode)) |
323 | return 0; | 329 | return 0; |
324 | if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) | 330 | if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) |