函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Copy the vma structure to a new location in the same mm,* prior to moving page table entries, to effect an mremap move.

函数原型:struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, unsigned long addr, unsigned long len, unsigned long pgoff, bool *need_rmap_locks)

返回类型:struct vm_area_struct

参数:

类型参数名称
struct vm_area_struct **vmap
unsigned longaddr
unsigned longlen
unsigned longpgoff
bool *need_rmap_locks
3191  vma等于vmap
3192  vma_start等于Our start address within vm_mm.
3193  mm等于The address space we belong to.
3196  bool faulted_in_anon_vma = true
3202  如果此条件成立可能性小(为编译器优化)(vma_is_anonymous(vma) && !Serialized by page_table_lock )则
3203  pgoff等于addr右移PAGE_SHIFT determines the page size
3204  faulted_in_anon_vma = false
3207  如果find_vma_links(mm, addr, addr + len, & prev, & rb_link, & rb_parent)则返回:NULL
3209  new_vma等于Given a mapping request (addr,end,vm_flags,file,pgoff), figure out* whether that can be merged with its predecessor or its successor
3212  如果new_vma
3231  vmap等于vma等于new_vma
3233  need_rmap_locks等于Offset (within vm_file) in PAGE_SIZEunits 小于等于Offset (within vm_file) in PAGE_SIZEunits
3234  否则
3235  new_vma等于vm_area_dup(vma)
3236  如果非new_vma则转到:out
3238  Our start address within vm_mm. 等于addr
3239  The first byte after our end addresswithin vm_mm. 等于addrlen
3240  Offset (within vm_file) in PAGE_SIZEunits 等于pgoff
3241  如果vma_dup_policy(vma, new_vma)则转到:out_free_vma
3243  如果anon_vma_clone(new_vma, vma)则转到:out_free_mempol
3245  如果File we map to (can be NULL). get_file(File we map to (can be NULL). )
3247  如果Function pointers to deal with this struct. openopen(new_vma)
3249  vma_link(mm, new_vma, prev, rb_link, rb_parent)
3250  * need_rmap_locks = false
3252  返回:new_vma
3254  out_free_mempol :
3255  mpol_put(vma_policy(new_vma))
3256  out_free_vma :
3257  vm_area_free(new_vma)
3258  out :
3259  返回:NULL
调用者
名称描述
move_vma