Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ksys_mmap_pgoff

Proto:unsigned long ksys_mmap_pgoff(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff)

Type:unsigned long

Parameter:

TypeParameterName
unsigned longaddr
unsigned longlen
unsigned longprot
unsigned longflags
unsigned longfd
unsigned longpgoff
1559  struct file * file = NULL
1562  If Not (flags & don't use a file ) Then
1563  audit_mmap_fd(fd, flags)
1564  file = fget(fd)
1565  If Not file Then Return -EBADF
1567  If is_file_hugepages(file) Then len = @a is a power of 2 value (len, huge_page_size(hstate_file(file)))
1569  retval = -EINVAL
1570  If Value for the false possibility is greater at compile time(flags & create a huge page mapping && !is_file_hugepages(file)) Then Go to out_fput
1572  Else if flags & create a huge page mapping Then
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  If Not hs Then Return -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  If IS_ERR(file) Then Return PTR_ERR(file)
1595  flags &= ~(mark it as an executable | ETXTBSY )
1597  retval = vm_mmap_pgoff(file, addr, len, prot, flags, pgoff)
1598  out_fput :
1599  If file Then fput(file)
1601  Return retval
Caller
NameDescribe
SYSCALL_DEFINE6
SYSCALL_DEFINE1
SYSCALL_DEFINE6
SYSCALL_DEFINE1