Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:This is the old fallback for page remapping.* For historical reasons, it only allows reserved pages. Only* old drivers should use this, and they needed to mark their* pages reserved for the old functions anyway.

Proto:static int insert_page(struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot)

Type:int

Parameter:

TypeParameterName
struct vm_area_struct *vma
unsigned longaddr
struct page *page
pgprot_tprot
1443  mm = The address space we belong to.
1448  retval = -EINVAL
1449  If PageAnon(page) || PageSlab(page) || page_has_type(page) Then Go to out
1451  retval = -ENOMEM
1452  flush_dcache_page(page)
1453  pte = get_locked_pte(mm, addr, & ptl)
1454  If Not pte Then Go to out
1456  retval = -EBUSY
1457  If Not pte_none( * pte) Then Go to out_unlock
1461  get_page(page)
1462  inc_mm_counter_fast(mm, Optimized variant when page is already known not to be PageAnon )
1463  page_add_file_rmap - add pte mapping to a file page*@page: the page to add the mapping to*@compound: charge the page as compound or small page* The caller needs to hold the pte lock.
1464  set_pte_at(mm, addr, pte, Conversion functions: convert a page and protection to a page entry,* and a page entry and page directory to the page they refer to.* (Currently stuck as a macro because of indirect forward reference* to linux/mm.h:page_to_nid())(page, prot))
1466  retval = 0
1467  out_unlock :
1468  pte_unmap_unlock(pte, ptl)
1469  out :
1470  Return retval
Caller
NameDescribe
vm_insert_pagevm_insert_page - insert single page into user vma*@vma: user vma to map to*@addr: target user address of this page*@page: source kernel page* This allows drivers to insert individual pages they've allocated* into a user vma.
__vm_insert_mixed