mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]>
This commit is contained in:
parent
bcddc3f01c
commit
b6e51316da
5 changed files with 75 additions and 95 deletions
|
|
@ -582,16 +582,8 @@ static void balance_dirty_pages(struct address_space *mapping)
|
|||
if ((laptop_mode && pages_written) ||
|
||||
(!laptop_mode && ((nr_writeback = global_page_state(NR_FILE_DIRTY)
|
||||
+ global_page_state(NR_UNSTABLE_NFS))
|
||||
> background_thresh))) {
|
||||
struct writeback_control wbc = {
|
||||
.bdi = bdi,
|
||||
.sync_mode = WB_SYNC_NONE,
|
||||
.nr_to_write = nr_writeback,
|
||||
};
|
||||
|
||||
|
||||
bdi_start_writeback(&wbc);
|
||||
}
|
||||
> background_thresh)))
|
||||
bdi_start_writeback(bdi, nr_writeback);
|
||||
}
|
||||
|
||||
void set_page_dirty_balance(struct page *page, int page_mkwrite)
|
||||
|
|
|
|||
Loading…
Reference in a new issue