Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\page-writeback.c Create Date:2022-07-28 14:11:00
Last Modify:2022-05-23 13:25:58 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:write_cache_pages - walk the list of dirty pages of the given address space and write all of them

Proto:int write_cache_pages(struct address_space *mapping, struct writeback_control *wbc, writepage_t writepage, void *data)

Type:int

Parameter:

TypeParameterName
struct address_space *mapping
struct writeback_control *wbc
writepage_twritepage
void *data
2162  ret = 0
2163  done = 0
2167  writeback_index = writeback_index
2171  range_whole = 0
2174  pagevec_init( & pvec)
2175  If ange_start is cyclic Then
2176  writeback_index = writeback_index
2177  index = writeback_index
2178  end = -1
2179  Else
2180  index = For a_ops->writepages(): if start or end are non-zero then this is* a hint that the filesystem need only write out the pages inside that* byterange. The byte at `end' is included in the writeout request. >> PAGE_SHIFT determines the page size
2181  end = range_end >> PAGE_SHIFT determines the page size
2182  If For a_ops->writepages(): if start or end are non-zero then this is* a hint that the filesystem need only write out the pages inside that* byterange. The byte at `end' is included in the writeout request. == 0 && range_end == LLONG_MAX Then range_whole = 1
2185  If sync_mode == WB_SYNC_ALL || ag-and-write to avoid livelock Then tag = PAGECACHE_TAG_TOWRITE
2187  Else tag = XArray tags, for tagging dirty and writeback pages in the pagecache.
2189  If sync_mode == WB_SYNC_ALL || ag-and-write to avoid livelock Then ag_pages_for_writeback - tag pages to be written by write_cache_pages*@mapping: address space structure to write*@start: starting page index*@end: ending page index (inclusive)* This function scans the page range from @start to @end (inclusive) and tags
2191  done_index = index
2192  When Not done && index <= end cycle
2195  nr_pages = pagevec_lookup_range_tag( & pvec, mapping, & index, end, tag)
2197  If nr_pages == 0 Then Break
2200  When i < nr_pages cycle
2201  page = pages[i]
2221  If Not PageDirty(page) Then
2223  Go to continue_unlock
2238  error = ( * writepage)(page, wbc, data)
2273  done = 1
2274  Break
2277  pagevec_release( & pvec)
2278  cond_resched()
2286  If ange_start is cyclic && Not done Then done_index = 0
2288  If ange_start is cyclic || range_whole && Write this many pages, and decrementthis for each page written > 0 Then writeback_index = done_index
2291  Return ret
Caller
NameDescribe
generic_writepagesgeneric_writepages - walk the list of dirty pages of the given address space and writepage() all of them
iomap_writepages