Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:follow_devmap_pmd

Proto:struct page *follow_devmap_pmd(struct vm_area_struct *vma, unsigned long addr, pmd_t *pmd, int flags, struct dev_pagemap **pgmap)

Type:struct page

Parameter:

TypeParameterName
struct vm_area_struct *vma
unsigned longaddr
pmd_t *pmd
intflags
struct dev_pagemap **pgmap
938  pfn = pmd_pfn( * pmd)
939  mm = The address space we belong to.
942  assert_spin_locked(pmd_lockptr(mm, pmd))
948  WARN_ONCE(flags & rnal GUP flag , "mm: In follow_devmap_pmd with FOLL_COW set")
950  If flags & check pte is writable && Not pmd_write( * pmd) Then Return NULL
953  If pmd_present( * pmd) && pmd_devmap( * pmd) Then Else
956  Return NULL
958  If flags & mark page accessed Then touch_pmd(vma, addr, pmd, flags)
965  If Not (flags & do get_page on page ) Then Return ERR_PTR( - EEXIST)
968  pfn += (addr & ~PMD_MASK) >> PAGE_SHIFT determines the page size
969  pgmap = get_dev_pagemap(pfn, * pgmap)
970  If Not pgmap Then Return ERR_PTR( - EFAULT)
972  page = pfn_to_page(pfn)
973  get_page(page)
975  Return page