函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memory.c Create Date:2022-07-27 16:07:53
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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.

函数原型:static int insert_page(struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot)

返回类型:int

参数:

类型参数名称
struct vm_area_struct *vma
unsigned longaddr
struct page *page
pgprot_tprot
1443  mm等于The address space we belong to.
1448  retval等于负EINVAL
1449  如果PageAnon(page)或PageSlab(page)或page_has_type(page)则转到:out
1451  retval等于负ENOMEM
1452  flush_dcache_page(page)
1453  pte等于get_locked_pte(mm, addr, & ptl)
1454  如果非pte则转到:out
1456  retval等于负EBUSY
1457  如果非pte_none( * pte)则转到: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  返回:retval
调用者
名称描述
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