函数逻辑报告 |
Source Code:mm\readahead.c |
Create Date:2022-07-27 15:35:41 |
Last Modify:2020-03-17 21:13:07 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:__do_page_cache_readahead() actually reads a chunk of disk. It allocates* the pages first, then submits them for I/O. This avoids the very bad* behaviour which would occur if page allocations are causing VM writeback.
函数原型:unsigned int __do_page_cache_readahead(struct address_space *mapping, struct file *filp, unsigned long offset, unsigned long nr_to_read, unsigned long lookahead_size)
返回类型:unsigned int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct address_space * | mapping | |
struct file * | filp | |
unsigned long | offset | |
unsigned long | nr_to_read | |
unsigned long | lookahead_size |
164 | nr_pages等于0 |
176 | 以page_idx小于nr_to_read循环 |
177 | page_offset等于offset加page_idx |
179 | 如果page_offset大于end_index则退出 |
182 | page等于xa_load() - Load an entry from an XArray.*@xa: XArray.*@index: index into array.* Context: Any context. Takes and releases the RCU lock.* Return: The entry at @index in @xa. |
192 | nr_pages等于0 |
193 | 继续下一循环 |
196 | page等于__page_cache_alloc(gfp_mask) |
200 | 添加链表项 |
201 | 如果page_idx恒等于nr_to_read减lookahead_size则SetPageReadahead(page) |
203 | nr_pages自加 |
214 | out : |
215 | 返回:nr_pages |
名称 | 描述 |
---|---|
force_page_cache_readahead | Chunk the readahead into 2 megabyte units, so that we don't pin too much* memory at once. |
ondemand_readahead | A minimal readahead algorithm for trivial sequential/random reads. |
ra_submit | Submit IO for the read-ahead request in file_ra_state. |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |