Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:do_read_cache_page

Proto:static struct page *do_read_cache_page(struct address_space *mapping, unsigned long index, int (*filler)(void *, struct page *), void *data, gfp_t gfp)

Type:struct page

Parameter:

TypeParameterName
struct address_space *mapping
unsigned longindex
int (*filler
void *data
gfp_tgfp
2764  repeat :
2765  page = d_get_page - find and get a page reference*@mapping: the address_space to search*@offset: the page index* Looks up the page cache slot at @mapping & @offset. If there is a* page cache page, it is returned with an increased refcount.
2766  If Not page Then
2767  page = __page_cache_alloc(gfp)
2768  If Not page Then Return ERR_PTR( - ENOMEM)
2770  err = add_to_page_cache_lru(page, mapping, index, gfp)
2772  put_page(page)
2773  If err == -EEXIST Then Go to repeat
2776  Return ERR_PTR(err)
2779  filler :
2780  If filler Then err = filler(data, page)
2782  Else err = readpage(data, page)
2785  If err < 0 Then
2786  put_page(page)
2787  Return ERR_PTR(err)
2790  page = wait_on_page_read(page)
2791  If IS_ERR(page) Then Return page
2793  Go to out
2795  If PageUptodate(page) Then Go to out
2829  Wait for a page to be unlocked.* This must be called with the caller "holding" the page,* ie with increased "page->count" so that the page won't* go away during the wait..
2830  If PageUptodate(page) Then Go to out
2834  lock_page may only be called if we have the page's inode pinned.
2837  If Not See page-flags.h for PAGE_MAPPING_FLAGS Then
2838  lock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
2839  put_page(page)
2840  Go to repeat
2844  If PageUptodate(page) Then
2845  lock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
2846  Go to out
2848  Go to filler
2850  out :
2851  mark_page_accessed(page)
2852  Return page
Caller
NameDescribe
read_cache_pagead_cache_page - read into page cache, fill it if needed*@mapping: the page's address_space*@index: the page index*@filler: function to perform the read*@data: first arg to filler(data, page) function, often left as NULL* Read into the page cache
read_cache_page_gfpad_cache_page_gfp - read into page cache, using specified page allocation flags