Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, unsigned long addr, unsigned long len, unsigned long pgoff, bool *need_rmap_locks)

Type:struct vm_area_struct

Parameter:

TypeParameterName
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  If Value for the false possibility is greater at compile time(vma_is_anonymous(vma) && !Serialized by page_table_lock ) Then
3203  pgoff = addr >> PAGE_SHIFT determines the page size
3204  faulted_in_anon_vma = false
3207  If find_vma_links(mm, addr, addr + len, & prev, & rb_link, & rb_parent) Then Return 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  If new_vma Then
3231  vmap = vma = new_vma
3233  need_rmap_locks = Offset (within vm_file) in PAGE_SIZEunits <= Offset (within vm_file) in PAGE_SIZEunits
3234  Else
3235  new_vma = vm_area_dup(vma)
3236  If Not new_vma Then Go to out
3238  Our start address within vm_mm. = addr
3239  The first byte after our end addresswithin vm_mm. = addr + len
3240  Offset (within vm_file) in PAGE_SIZEunits = pgoff
3241  If vma_dup_policy(vma, new_vma) Then Go to out_free_vma
3243  If anon_vma_clone(new_vma, vma) Then Go to out_free_mempol
3245  If File we map to (can be NULL). Then get_file(File we map to (can be NULL). )
3247  If Function pointers to deal with this struct. && open Then open(new_vma)
3249  vma_link(mm, new_vma, prev, rb_link, rb_parent)
3250  * need_rmap_locks = false
3252  Return 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  Return NULL
Caller
NameDescribe
move_vma