Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:get_unmapped_area

Proto:unsigned long get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags)

Type:unsigned long

Parameter:

TypeParameterName
struct file *file
unsigned longaddr
unsigned longlen
unsigned longpgoff
unsigned longflags
2172  unsigned long( * get_area)(struct file * , unsigned long, unsigned long, unsigned long, unsigned long)
2175  error = arch_mmap_check(addr, len, flags)
2176  If error Then Return error
2180  If len > TASK_SIZE Then Return -ENOMEM
2183  get_area = get_unmapped_area
2184  If file Then
2185  If get_unmapped_area Then get_area = get_unmapped_area
2187  Else if flags & Share changes Then
2193  pgoff = 0
2194  get_area = shmem_get_unmapped_area
2197  addr = get_area(file, addr, len, pgoff, flags)
2198  If IS_ERR_VALUE(addr) Then Return addr
2201  If addr > TASK_SIZE - len Then Return -ENOMEM
2203  If offset_in_page(addr) Then Return -EINVAL
2206  error = security_mmap_addr(addr)
2207  Return If error Then error Else addr
Caller
NameDescribe
do_mmapThe caller must hold down_write(¤t->mm->mmap_sem).
do_brk_flagshis is really a simplified "do_mmap". it only handles* anonymous maps. eventually we may be able to do some* brk-specific accounting here.
mremap_to
vma_expandable
SYSCALL_DEFINE5Expand (or shrink) an existing mapping, potentially moving it at the* same time (controlled by the MREMAP_MAYMOVE flag and available VM space)* MREMAP_FIXED option added 5-Dec-1999 by Benjamin LaHaise* This option implies MREMAP_MAYMOVE.