Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Do a chunk of "sys_mincore()". We've already checked* all the arguments, we hold the mmap semaphore: we should* just return the amount of info we're asked for.

Proto:static long do_mincore(unsigned long addr, unsigned long pages, unsigned char *vec)

Type:long

Parameter:

TypeParameterName
unsigned longaddr
unsigned longpages
unsigned char *vec
213  vma = Look up the first VMA which satisfies addr < vm_end, NULL if none.
214  If Not vma || addr < Our start address within vm_mm. Then Return -ENOMEM
216  end = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(The first byte after our end addresswithin vm_mm. , addr + (pages << PAGE_SHIFT determines the page size ))
217  If Not can_do_mincore(vma) Then
218  pages = DIV_ROUND_UP(end - addr, PAGE_SIZE)
219  memset(vec, 1, pages)
220  Return pages
222  err = walk_page_range(The address space we belong to. , addr, end, & mincore_walk_ops, vec)
223  If err < 0 Then Return err
225  Return end - addr >> PAGE_SHIFT determines the page size
Caller
NameDescribe
SYSCALL_DEFINE3The mincore(2) system call