aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page-writeback.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r--mm/page-writeback.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 143c1c25d680..b901fe52b153 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -2366,15 +2366,16 @@ int do_writepages(struct address_space *mapping, struct writeback_control *wbc)
2366} 2366}
2367 2367
2368/** 2368/**
2369 * write_one_page - write out a single page and optionally wait on I/O 2369 * write_one_page - write out a single page and wait on I/O
2370 * @page: the page to write 2370 * @page: the page to write
2371 * @wait: if true, wait on writeout
2372 * 2371 *
2373 * The page must be locked by the caller and will be unlocked upon return. 2372 * The page must be locked by the caller and will be unlocked upon return.
2374 * 2373 *
2375 * write_one_page() returns a negative error code if I/O failed. 2374 * write_one_page() returns a negative error code if I/O failed. Note that
2375 * the address_space is not marked for error. The caller must do this if
2376 * needed.
2376 */ 2377 */
2377int write_one_page(struct page *page, int wait) 2378int write_one_page(struct page *page)
2378{ 2379{
2379 struct address_space *mapping = page->mapping; 2380 struct address_space *mapping = page->mapping;
2380 int ret = 0; 2381 int ret = 0;
@@ -2385,13 +2386,12 @@ int write_one_page(struct page *page, int wait)
2385 2386
2386 BUG_ON(!PageLocked(page)); 2387 BUG_ON(!PageLocked(page));
2387 2388
2388 if (wait) 2389 wait_on_page_writeback(page);
2389 wait_on_page_writeback(page);
2390 2390
2391 if (clear_page_dirty_for_io(page)) { 2391 if (clear_page_dirty_for_io(page)) {
2392 get_page(page); 2392 get_page(page);
2393 ret = mapping->a_ops->writepage(page, &wbc); 2393 ret = mapping->a_ops->writepage(page, &wbc);
2394 if (ret == 0 && wait) { 2394 if (ret == 0) {
2395 wait_on_page_writeback(page); 2395 wait_on_page_writeback(page);
2396 if (PageError(page)) 2396 if (PageError(page))
2397 ret = -EIO; 2397 ret = -EIO;