函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\readahead.c Create Date:2022-07-27 15:35:44
Last Modify:2020-03-17 21:13:07 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Chunk the readahead into 2 megabyte units, so that we don't pin too much* memory at once.

函数原型:int force_page_cache_readahead(struct address_space *mapping, struct file *filp, unsigned long offset, unsigned long nr_to_read)

返回类型:int

参数:

类型参数名称
struct address_space *mapping
struct file *filp
unsigned longoffset
unsigned longnr_to_read
225  bdi等于inode_to_bdi(host)
226  ra等于f_ra
229  如果此条件成立可能性小(为编译器优化)(!readpage && !readpages)则返回:负EINVAL
236  max_pages等于max_t - return maximum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(unsignedlong, max allowed IO size , Maximum readahead window )
237  nr_to_read等于两数取小(nr_to_read, max_pages)
238 nr_to_read循环
239  this_chunk等于2乘1024乘1024除PAGE_SIZE
241  如果this_chunk大于nr_to_readthis_chunk等于nr_to_read
243  __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.
245  offset加等于this_chunk
246  nr_to_read减等于this_chunk
248  返回:0
调用者
名称描述
page_cache_sync_readaheadpage_cache_sync_readahead - generic file readahead*@mapping: address_space which holds the pagecache and I/O vectors*@ra: file_ra_state which holds the readahead state*@filp: passed on to ->readpage() and ->readpages()*@offset: start offset into @mapping,
generic_fadvisePOSIX_FADV_WILLNEED could set PG_Referenced, and POSIX_FADV_NOREUSE could* deactivate the pages and clear PG_Referenced.