diff options
Diffstat (limited to 'fs/ocfs2/alloc.c')
-rw-r--r-- | fs/ocfs2/alloc.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 47201b67dbf..ebfe36ab2d5 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c | |||
@@ -6421,20 +6421,13 @@ bail: | |||
6421 | return status; | 6421 | return status; |
6422 | } | 6422 | } |
6423 | 6423 | ||
6424 | static int ocfs2_writeback_zero_func(handle_t *handle, struct buffer_head *bh) | 6424 | static int ocfs2_zero_func(handle_t *handle, struct buffer_head *bh) |
6425 | { | 6425 | { |
6426 | set_buffer_uptodate(bh); | 6426 | set_buffer_uptodate(bh); |
6427 | mark_buffer_dirty(bh); | 6427 | mark_buffer_dirty(bh); |
6428 | return 0; | 6428 | return 0; |
6429 | } | 6429 | } |
6430 | 6430 | ||
6431 | static int ocfs2_ordered_zero_func(handle_t *handle, struct buffer_head *bh) | ||
6432 | { | ||
6433 | set_buffer_uptodate(bh); | ||
6434 | mark_buffer_dirty(bh); | ||
6435 | return ocfs2_journal_dirty_data(handle, bh); | ||
6436 | } | ||
6437 | |||
6438 | static void ocfs2_map_and_dirty_page(struct inode *inode, handle_t *handle, | 6431 | static void ocfs2_map_and_dirty_page(struct inode *inode, handle_t *handle, |
6439 | unsigned int from, unsigned int to, | 6432 | unsigned int from, unsigned int to, |
6440 | struct page *page, int zero, u64 *phys) | 6433 | struct page *page, int zero, u64 *phys) |
@@ -6453,17 +6446,18 @@ static void ocfs2_map_and_dirty_page(struct inode *inode, handle_t *handle, | |||
6453 | * here if they aren't - ocfs2_map_page_blocks() | 6446 | * here if they aren't - ocfs2_map_page_blocks() |
6454 | * might've skipped some | 6447 | * might've skipped some |
6455 | */ | 6448 | */ |
6456 | if (ocfs2_should_order_data(inode)) { | 6449 | ret = walk_page_buffers(handle, page_buffers(page), |
6457 | ret = walk_page_buffers(handle, | 6450 | from, to, &partial, |
6458 | page_buffers(page), | 6451 | ocfs2_zero_func); |
6459 | from, to, &partial, | 6452 | if (ret < 0) |
6460 | ocfs2_ordered_zero_func); | 6453 | mlog_errno(ret); |
6461 | if (ret < 0) | 6454 | else if (ocfs2_should_order_data(inode)) { |
6462 | mlog_errno(ret); | 6455 | ret = ocfs2_jbd2_file_inode(handle, inode); |
6463 | } else { | 6456 | #ifdef CONFIG_OCFS2_COMPAT_JBD |
6464 | ret = walk_page_buffers(handle, page_buffers(page), | 6457 | ret = walk_page_buffers(handle, page_buffers(page), |
6465 | from, to, &partial, | 6458 | from, to, &partial, |
6466 | ocfs2_writeback_zero_func); | 6459 | ocfs2_journal_dirty_data); |
6460 | #endif | ||
6467 | if (ret < 0) | 6461 | if (ret < 0) |
6468 | mlog_errno(ret); | 6462 | mlog_errno(ret); |
6469 | } | 6463 | } |