Function report |
Source Code:mm\mremap.c |
Create Date:2022-07-28 14:53:22 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:vma_to_resize
Proto:static struct vm_area_struct *vma_to_resize(unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long *p)
Type:struct vm_area_struct
Parameter:
Type | Parameter | Name |
---|---|---|
unsigned long | addr | |
unsigned long | old_len | |
unsigned long | new_len | |
unsigned long * | p |
440 | If Not vma || Our start address within vm_mm. > addr Then Return ERR_PTR( - EFAULT) |
451 | If Not old_len && Not (Flags, see mm.h. & (VM_SHARED | VM_MAYSHARE)) Then |
452 | pr_warn_once("%s (%d): attempted to duplicate a private mapping with mremap. This is not supported.\n", comm, pid) |
456 | If is_vm_hugetlb_page(vma) Then Return ERR_PTR( - EINVAL) |
460 | If old_len > The first byte after our end addresswithin vm_mm. - addr Then Return ERR_PTR( - EFAULT) |
469 | If pgoff + (new_len >> PAGE_SHIFT determines the page size ) < pgoff Then Return ERR_PTR( - EINVAL) |
472 | If Flags, see mm.h. & (Cannot expand with mremap() | Page-ranges managed without "struct page", just pure PFN ) Then Return ERR_PTR( - EFAULT) |
475 | If Flags, see mm.h. & VM_LOCKED Then |
478 | lock_limit = rlimit(RLIMIT_MEMLOCK) |
480 | If locked > lock_limit && Not Check operation authority Then Return ERR_PTR( - EAGAIN) |
484 | If Not Return true if the calling process may expand its vm space by the passed* number of pages Then Return ERR_PTR( - ENOMEM) |
488 | If Flags, see mm.h. & Is a VM accounted object Then |
489 | charged = new_len - old_len >> PAGE_SHIFT determines the page size |
490 | If security_vm_enough_memory_mm(mm, charged) Then Return ERR_PTR( - ENOMEM) |
495 | Return vma |
Name | Describe |
---|---|
mremap_to | |
SYSCALL_DEFINE5 | Expand (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. |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |