alloc.c (8d6220d6a74a33552cf877bcea25503d7f6a59e6) | alloc.c (2b4e30fbde425828b17f0e9c8f8e3fd3ecb2bc75) |
---|---|
1/* -*- mode: c; c-basic-offset: 8; -*- 2 * vim: noexpandtab sw=8 ts=8 sts=0: 3 * 4 * alloc.c 5 * 6 * Extent allocs and frees 7 * 8 * Copyright (C) 2002, 2004 Oracle. All rights reserved. --- 6407 unchanged lines hidden (view full) --- 6416 } 6417 status = 0; 6418bail: 6419 6420 mlog_exit(status); 6421 return status; 6422} 6423 | 1/* -*- mode: c; c-basic-offset: 8; -*- 2 * vim: noexpandtab sw=8 ts=8 sts=0: 3 * 4 * alloc.c 5 * 6 * Extent allocs and frees 7 * 8 * Copyright (C) 2002, 2004 Oracle. All rights reserved. --- 6407 unchanged lines hidden (view full) --- 6416 } 6417 status = 0; 6418bail: 6419 6420 mlog_exit(status); 6421 return status; 6422} 6423 |
6424static int ocfs2_writeback_zero_func(handle_t *handle, struct buffer_head *bh) | 6424static int ocfs2_zero_func(handle_t *handle, struct buffer_head *bh) |
6425{ 6426 set_buffer_uptodate(bh); 6427 mark_buffer_dirty(bh); 6428 return 0; 6429} 6430 | 6425{ 6426 set_buffer_uptodate(bh); 6427 mark_buffer_dirty(bh); 6428 return 0; 6429} 6430 |
6431static 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 | |
6438static void ocfs2_map_and_dirty_page(struct inode *inode, handle_t *handle, 6439 unsigned int from, unsigned int to, 6440 struct page *page, int zero, u64 *phys) 6441{ 6442 int ret, partial = 0; 6443 6444 ret = ocfs2_map_page_blocks(page, phys, inode, from, to, 0); 6445 if (ret) 6446 mlog_errno(ret); 6447 6448 if (zero) 6449 zero_user_segment(page, from, to); 6450 6451 /* 6452 * Need to set the buffers we zero'd into uptodate 6453 * here if they aren't - ocfs2_map_page_blocks() 6454 * might've skipped some 6455 */ | 6431static void ocfs2_map_and_dirty_page(struct inode *inode, handle_t *handle, 6432 unsigned int from, unsigned int to, 6433 struct page *page, int zero, u64 *phys) 6434{ 6435 int ret, partial = 0; 6436 6437 ret = ocfs2_map_page_blocks(page, phys, inode, from, to, 0); 6438 if (ret) 6439 mlog_errno(ret); 6440 6441 if (zero) 6442 zero_user_segment(page, from, to); 6443 6444 /* 6445 * Need to set the buffers we zero'd into uptodate 6446 * here if they aren't - ocfs2_map_page_blocks() 6447 * might've skipped some 6448 */ |
6456 if (ocfs2_should_order_data(inode)) { 6457 ret = walk_page_buffers(handle, 6458 page_buffers(page), 6459 from, to, &partial, 6460 ocfs2_ordered_zero_func); 6461 if (ret < 0) 6462 mlog_errno(ret); 6463 } else { | 6449 ret = walk_page_buffers(handle, page_buffers(page), 6450 from, to, &partial, 6451 ocfs2_zero_func); 6452 if (ret < 0) 6453 mlog_errno(ret); 6454 else if (ocfs2_should_order_data(inode)) { 6455 ret = ocfs2_jbd2_file_inode(handle, inode); 6456#ifdef CONFIG_OCFS2_COMPAT_JBD |
6464 ret = walk_page_buffers(handle, page_buffers(page), 6465 from, to, &partial, | 6457 ret = walk_page_buffers(handle, page_buffers(page), 6458 from, to, &partial, |
6466 ocfs2_writeback_zero_func); | 6459 ocfs2_journal_dirty_data); 6460#endif |
6467 if (ret < 0) 6468 mlog_errno(ret); 6469 } 6470 6471 if (!partial) 6472 SetPageUptodate(page); 6473 6474 flush_dcache_page(page); --- 654 unchanged lines hidden --- | 6461 if (ret < 0) 6462 mlog_errno(ret); 6463 } 6464 6465 if (!partial) 6466 SetPageUptodate(page); 6467 6468 flush_dcache_page(page); --- 654 unchanged lines hidden --- |