函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:get_unmapped_area

函数原型:unsigned long get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags)

返回类型:unsigned long

参数:

类型参数名称
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  如果error则返回:error
2180  如果len大于TASK_SIZE则返回:负ENOMEM
2183  get_area等于get_unmapped_area
2184  如果file
2185  如果get_unmapped_areaget_area等于get_unmapped_area
2187  否则如果flags按位与Share changes
2193  pgoff等于0
2194  get_area等于shmem_get_unmapped_area
2197  addr等于get_area(file, addr, len, pgoff, flags)
2198  如果IS_ERR_VALUE(addr)则返回:addr
2201  如果addr大于TASK_SIZElen则返回:负ENOMEM
2203  如果offset_in_page(addr)则返回:负EINVAL
2206  error等于security_mmap_addr(addr)
2207  返回:如果errorerror否则addr
调用者
名称描述
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.
xol_add_vmaSlot allocation for XOL