Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:pagecache_get_page - find and get a page reference*@mapping: the address_space to search*@offset: the page index*@fgp_flags: PCG flags*@gfp_mask: gfp mask to use for the page cache data page allocation* Looks up the page cache slot at @mapping & @offset.

Proto:struct page *pagecache_get_page(struct address_space *mapping, unsigned long offset, int fgp_flags, gfp_t gfp_mask)

Type:struct page

Parameter:

TypeParameterName
struct address_space *mapping
unsigned longoffset
intfgp_flags
gfp_tgfp_mask
1634  repeat :
1635  page = d_get_entry - find and get a page cache entry*@mapping: the address_space to search*@offset: the page cache index* Looks up the page cache slot at @mapping & @offset
1636  If xa_is_value() - Determine if an entry is a value.*@entry: XArray entry.* Context: Any context.* Return: True if the entry is a value, false if it is a pointer. Then page = NULL
1638  If Not page Then Go to no_page
1641  If fgp_flags & FGP_LOCK Then
1642  If fgp_flags & FGP_NOWAIT Then
1644  put_page(page)
1645  Return NULL
1647  Else
1654  put_page(page)
1655  Go to repeat
1657  VM_BUG_ON_PAGE( Our offset within mapping. != offset, page)
1660  If fgp_flags & FGP_ACCESSED Then mark_page_accessed(page)
1663  no_page :
1664  If Not page && fgp_flags & FGP_CREAT Then
1666  If fgp_flags & FGP_WRITE && mapping_cap_account_dirty(mapping) Then gfp_mask |= __GFP_WRITE
1668  If fgp_flags & FGP_NOFS Then gfp_mask &= ~__GFP_FS
1671  page = __page_cache_alloc(gfp_mask)
1672  If Not page Then Return NULL
1675  If WARN_ON_ONCE(!(fgp_flags & (FGP_LOCK | FGP_FOR_MMAP))) Then fgp_flags |= FGP_LOCK
1679  If fgp_flags & FGP_ACCESSED Then __SetPageReferenced(page)
1682  err = add_to_page_cache_lru(page, mapping, offset, gfp_mask)
1684  put_page(page)
1685  page = NULL
1686  If err == -EEXIST Then Go to repeat
1694  If page && fgp_flags & FGP_FOR_MMAP Then 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.
1698  Return page
Caller
NameDescribe
filemap_faultlemap_fault - read in file data for page fault handling*@vmf: struct vm_fault containing details of the fault* filemap_fault() is invoked via the vma operations vector for a* mapped memory region to read in file data during a page fault
grab_cache_page_write_beginFind or create a page at the given pagecache position. Return the locked* page. This function is specifically for buffered writes.
find_get_paged_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.
find_get_page_flags
find_lock_pagelocate, pin and lock a pagecache page
find_or_create_paged_or_create_page - locate or add a pagecache page*@mapping: the page's address_space*@index: the page's index into the mapping*@gfp_mask: page allocation mode* Looks up the page cache slot at @mapping & @offset
grab_cache_page_nowaitgrab_cache_page_nowait - returns locked page at given index in given cache*@mapping: target address_space*@index: the page index* Same as grab_cache_page(), but do not wait if the page is unavailable