函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\page-writeback.c Create Date:2022-07-27 15:34:37
Last Modify:2022-05-23 13:25:58 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:write_cache_pages - walk the list of dirty pages of the given address space and write all of them

函数原型:int write_cache_pages(struct address_space *mapping, struct writeback_control *wbc, writepage_t writepage, void *data)

返回类型:int

参数:

类型参数名称
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  如果ange_start is cyclic
2176  writeback_index等于writeback_index
2177  index等于writeback_index
2178  end等于负1
2179  否则
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  如果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_MAXrange_whole等于1
2185  如果sync_mode恒等于WB_SYNC_ALLag-and-write to avoid livelock tag等于PAGECACHE_TAG_TOWRITE
2187  否则tag等于XArray tags, for tagging dirty and writeback pages in the pagecache.
2189  如果sync_mode恒等于WB_SYNC_ALLag-and-write to avoid livelock 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  当非doneindex小于等于end循环
2195  nr_pages等于pagevec_lookup_range_tag( & pvec, mapping, & index, end, tag)
2197  如果nr_pages恒等于0则退出
2200 i小于nr_pages循环
2201  page等于pages[i]
2221  如果非PageDirty(page)则
2223  转到:continue_unlock
2238  error = ( * writepage)(page, wbc, data)
2273  done等于1
2274  退出
2277  pagevec_release( & pvec)
2278  cond_resched()
2286  如果ange_start is cyclic 且非donedone_index等于0
2288  如果ange_start is cyclic range_wholeWrite this many pages, and decrementthis for each page written 大于0则writeback_index等于done_index
2291  返回:ret
调用者
名称描述
generic_writepagesgeneric_writepages - walk the list of dirty pages of the given address space and writepage() all of them
iomap_writepages
mpage_writepagesmpage_writepages - walk the list of dirty pages of the given address space & writepage() all of them*@mapping: address space structure to write*@wbc: subtract the number of written pages from *@wbc->nr_to_write