Function report |
Source Code:mm\mremap.c |
Create Date:2022-07-28 14:53:15 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:move_vma
Proto:static unsigned long move_vma(struct vm_area_struct *vma, unsigned long old_addr, unsigned long old_len, unsigned long new_len, unsigned long new_addr, bool *locked, struct vm_userfaultfd_ctx *uf, struct list_head *uf_unmap)
Type:unsigned long
Parameter:
Type | Parameter | Name |
---|---|---|
struct vm_area_struct * | vma | |
unsigned long | old_addr | |
unsigned long | old_len | |
unsigned long | new_len | |
unsigned long | new_addr | |
bool * | locked | |
struct vm_userfaultfd_ctx * | uf | |
struct list_head * | uf_unmap |
326 | vm_flags = Flags, see mm.h. |
329 | excess = 0 |
331 | split = 0 |
339 | If number of VMAs >= sysctl_max_map_count - 3 Then Return -ENOMEM |
349 | err = ksm_madvise(vma, old_addr, old_addr + old_len, KSM may not merge identical pages , & vm_flags) |
354 | new_pgoff = Offset (within vm_file) in PAGE_SIZEunits + ( old_addr - Our start address within vm_mm. >> PAGE_SHIFT determines the page size ) |
355 | new_vma = Copy the vma structure to a new location in the same mm,* prior to moving page table entries, to effect an mremap move. |
360 | moved_len = move_page_tables(vma, old_addr, new_vma, new_addr, old_len, need_rmap_locks) |
364 | Else if Function pointers to deal with this struct. && mremap Then |
380 | Else |
381 | mremap_userfaultfd_prep(new_vma, uf) |
387 | If vm_flags & Is a VM accounted object Then |
389 | excess = The first byte after our end addresswithin vm_mm. - Our start address within vm_mm. - old_len |
390 | If old_addr > Our start address within vm_mm. && old_addr + old_len < The first byte after our end addresswithin vm_mm. Then split = 1 |
408 | If Value for the false possibility is greater at compile time(Flags, see mm.h. & Page-ranges managed without "struct page", just pure PFN ) Then untrack_pfn_moved(vma) |
414 | excess = 0 |
419 | If excess Then |
421 | If split Then Flags, see mm.h. |= Is a VM accounted object |
427 | * locked = true |
430 | Return new_addr |
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 |