diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2009-09-16 09:13:54 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-09-16 09:18:52 -0400 |
commit | b6e51316daede0633e9274e1e30391cfa4747877 (patch) | |
tree | 664476bb4e7c05dcce3ad908363b482134c68429 /mm | |
parent | bcddc3f01c9122882c8b9f12ab94a934e55aef97 (diff) |
writeback: separate starting of sync vs opportunistic writeback
bdi_start_writeback() is currently split into two paths, one for
WB_SYNC_NONE and one for WB_SYNC_ALL. Add bdi_sync_writeback()
for WB_SYNC_ALL writeback and let bdi_start_writeback() handle
only WB_SYNC_NONE.
Push down the writeback_control allocation and only accept the
parameters that make sense for each function. This cleans up
the API considerably.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/page-writeback.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 12c3d843ce93..1eea4fa0d410 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
@@ -582,16 +582,8 @@ static void balance_dirty_pages(struct address_space *mapping) | |||
582 | if ((laptop_mode && pages_written) || | 582 | if ((laptop_mode && pages_written) || |
583 | (!laptop_mode && ((nr_writeback = global_page_state(NR_FILE_DIRTY) | 583 | (!laptop_mode && ((nr_writeback = global_page_state(NR_FILE_DIRTY) |
584 | + global_page_state(NR_UNSTABLE_NFS)) | 584 | + global_page_state(NR_UNSTABLE_NFS)) |
585 | > background_thresh))) { | 585 | > background_thresh))) |
586 | struct writeback_control wbc = { | 586 | bdi_start_writeback(bdi, nr_writeback); |
587 | .bdi = bdi, | ||
588 | .sync_mode = WB_SYNC_NONE, | ||
589 | .nr_to_write = nr_writeback, | ||
590 | }; | ||
591 | |||
592 | |||
593 | bdi_start_writeback(&wbc); | ||
594 | } | ||
595 | } | 587 | } |
596 | 588 | ||
597 | void set_page_dirty_balance(struct page *page, int page_mkwrite) | 589 | void set_page_dirty_balance(struct page *page, int page_mkwrite) |