Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:read_pages

Proto:static int read_pages(struct address_space *mapping, struct file *filp, struct list_head *pages, unsigned int nr_pages, gfp_t gfp)

Type:int

Parameter:

TypeParameterName
struct address_space *mapping
struct file *filp
struct list_head *pages
unsigned intnr_pages
gfp_tgfp
123  blk_start_plug( & plug)
125  If readpages Then
126  ret = readpages(filp, mapping, pages, nr_pages)
128  put_pages_list(pages)
129  Go to out
132  When page_idx < nr_pages cycle
133  page = lru_to_page(pages)
134  deletes entry from list
135  If Not add_to_page_cache_lru(page, mapping, Our offset within mapping. , gfp) Then readpage(filp, page)
137  put_page(page)
139  ret = 0
141  out :
142  blk_finish_plug( & plug)
144  Return ret
Caller
NameDescribe
__do_page_cache_readahead__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.