1WRITE_CACHE_PAGES(9) Memory Management in Linux WRITE_CACHE_PAGES(9)
2
3
4
6 write_cache_pages - walk the list of dirty pages of the given address
7 space and write all of them.
8
10 int write_cache_pages(struct address_space * mapping,
11 struct writeback_control * wbc,
12 writepage_t writepage, void * data);
13
15 mapping
16 address space structure to write
17
18 wbc
19 subtract the number of written pages from *wbc->nr_to_write
20
21 writepage
22 function called for each page
23
24 data
25 data passed to writepage function
26
28 If a page is already under I/O, write_cache_pages skips it, even if
29 it's dirty. This is desirable behaviour for memory-cleaning writeback,
30 but it is INCORRECT for data-integrity system calls such as fsync.
31 fsync and msync need to guarantee that all the data which was dirty at
32 the time the call was made get new I/O started against them. If
33 wbc->sync_mode is WB_SYNC_ALL then we were called for data integrity
34 and we must wait for existing IO to complete.
35
37Kernel Hackers Manual 2.6. November 2011 WRITE_CACHE_PAGES(9)