Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\readahead.c Create Date:2022-07-28 14:12:02
Last Modify:2020-03-17 21:13:07 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

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

Proto:int force_page_cache_readahead(struct address_space *mapping, struct file *filp, unsigned long offset, unsigned long nr_to_read)

Type:int

Parameter:

TypeParameterName
struct address_space *mapping
struct file *filp
unsigned longoffset
unsigned longnr_to_read
225  bdi = inode_to_bdi(host)
226  ra = f_ra
229  If Value for the false possibility is greater at compile time(!readpage && !readpages) Then Return -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 = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(nr_to_read, max_pages)
238  When nr_to_read cycle
239  this_chunk = 2 * 1024 * 1024 / PAGE_SIZE
241  If this_chunk > nr_to_read Then this_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  Return 0
Caller
NameDescribe
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,