Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\nommu.c Create Date:2022-07-28 14:36:48
Last Modify:2020-03-17 21:26:27 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:add a VMA into a process's mm_struct in the appropriate place in the list* and tree and add to the address space's page tree also if not an anonymous* page* - should be called with mm->mmap_sem held writelocked

Proto:static void add_vma_to_mm(struct mm_struct *mm, struct vm_area_struct *vma)

Type:void

Parameter:

TypeParameterName
struct mm_struct *mm
struct vm_area_struct *vma
599  BUG_ON(!vm_region)
601  number of VMAs ++
602  The address space we belong to. = mm
605  If File we map to (can be NULL). Then
606  mapping = f_mapping
608  i_mmap_lock_write(mapping)
609  flush_dcache_mmap_lock(mapping)
610  vma_interval_tree_insert(vma, & i_mmap)
611  flush_dcache_mmap_unlock(mapping)
612  i_mmap_unlock_write(mapping)
616  parent = rb_prev = NULL
617  p = rb_node
618  When p cycle
619  parent = p
620  pvma = rb_entry(parent, structvm_area_struct, vm_rb)
624  If Our start address within vm_mm. < Our start address within vm_mm. Then p = rb_left
627  rb_prev = parent
628  p = rb_right
629  Else if The first byte after our end addresswithin vm_mm. < The first byte after our end addresswithin vm_mm. Then p = rb_left
632  rb_prev = parent
633  p = rb_right
634  Else if vma < pvma Then p = rb_left
636  Else if vma > pvma Then
637  rb_prev = parent
638  p = rb_right
639  Else BUG()
643  rb_link_node( & vm_rb, parent, p)
644  rb_insert_color( & vm_rb, & mm_rb)
647  prev = NULL
648  If rb_prev Then prev = rb_entry(rb_prev, structvm_area_struct, vm_rb)
651  __vma_link_list(mm, vma, prev)
Caller
NameDescribe
do_mmaphandle mapping creation for uClinux
split_vmasplit a vma into two pieces at address 'addr', a new vma is allocated either* for the first part or the tail.
shrink_vmashrink a VMA by removing the specified chunk from either the beginning or* the end