Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mfill_zeropage_pte

Proto:static int mfill_zeropage_pte(struct mm_struct *dst_mm, pmd_t *dst_pmd, struct vm_area_struct *dst_vma, unsigned long dst_addr)

Type:int

Parameter:

TypeParameterName
struct mm_struct *dst_mm
pmd_t *dst_pmd
struct vm_area_struct *dst_vma
unsigned longdst_addr
153  _dst_pte = pte_mkspecial(pfn_pte(my_zero_pfn(dst_addr), Access permissions of this VMA. ))
155  dst_pte = pte_offset_map_lock(dst_mm, dst_pmd, dst_addr, & ptl)
156  If File we map to (can be NULL). Then
158  inode = f_inode
159  offset = linear_page_index(dst_vma, dst_addr)
160  max_off = DIV_ROUND_UP(NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they , PAGE_SIZE)
161  ret = -EFAULT
162  If Value for the false possibility is greater at compile time(offset >= max_off) Then Go to out_unlock
165  ret = -EEXIST
166  If Not pte_none( * dst_pte) Then Go to out_unlock
168  set_pte_at(dst_mm, dst_addr, dst_pte, _dst_pte)
170  The x86 doesn't have any external MMU info: the kernel page* tables contain all the necessary information.
171  ret = 0
172  out_unlock :
173  pte_unmap_unlock(dst_pte, ptl)
174  Return ret
Caller
NameDescribe
mfill_atomic_pte