函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:ksys_mmap_pgoff

函数原型:unsigned long ksys_mmap_pgoff(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff)

返回类型:unsigned long

参数:

类型参数名称
unsigned longaddr
unsigned longlen
unsigned longprot
unsigned longflags
unsigned longfd
unsigned longpgoff
1559  struct file * file = NULL
1562  如果非flags按位与don't use a file 的值则
1563  audit_mmap_fd(fd, flags)
1564  file等于fget(fd)
1565  如果非file则返回:负EBADF
1567  如果is_file_hugepages(file)则len等于@a is a power of 2 value (len, huge_page_size(hstate_file(file)))
1569  retval等于负EINVAL
1570  如果此条件成立可能性小(为编译器优化)(flags & create a huge page mapping && !is_file_hugepages(file))则转到:out_fput
1572  否则如果flags按位与create a huge page mapping
1573  struct user_struct * user = NULL
1576  hs等于hstate_sizelog((flags >> Huge page size encoding when MAP_HUGETLB is specified, and a huge page* size other than the default is desired) & MAP_HUGE_MASK)
1577  如果非hs则返回:负EINVAL
1580  len等于@a is a power of 2 value (len, huge_page_size(hs))
1587  file等于hugetlb_file_setup(HUGETLB_ANON_FILE, len, should the VM suppress accounting , & user, HUGETLB_ANONHUGE_INODE, (flags >> Huge page size encoding when MAP_HUGETLB is specified, and a huge page* size other than the default is desired) & MAP_HUGE_MASK)
1591  如果是错误则返回:错误
1595  flags与等于mark it as an executable 按位或ETXTBSY 的值的反
1597  retval等于vm_mmap_pgoff(file, addr, len, prot, flags, pgoff)
1598  out_fput :
1599  如果filefput(file)
1601  返回:retval
调用者
名称描述
SYSCALL_DEFINE6
SYSCALL_DEFINE1
SYSCALL_DEFINE6
SYSCALL_DEFINE1