Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:split a vma into two pieces at address 'addr', a new vma is allocated either* for the first part or the tail.

Proto:int split_vma(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, int new_below)

Type:int

Parameter:

TypeParameterName
struct mm_struct *mm
struct vm_area_struct *vma
unsigned longaddr
intnew_below
1393  If File we map to (can be NULL). Then Return -ENOMEM
1396  If number of VMAs >= sysctl_max_map_count Then Return -ENOMEM
1399  region = kmem_cache_alloc(list of mapped, potentially shareable regions , GFP_KERNEL)
1400  If Not region Then Return -ENOMEM
1403  new = vm_area_dup(vma)
1404  If Not new Then
1405  kmem_cache_free(list of mapped, potentially shareable regions , region)
1406  Return -ENOMEM
1410  region = vm_region
1411  vm_region = region
1413  npages = addr - Our start address within vm_mm. >> PAGE_SHIFT determines the page size
1415  If new_below Then
1416  gion allocated to here = gion initialised to here = The first byte after our end addresswithin vm_mm. = addr
1417  Else
1418  start address of region = Our start address within vm_mm. = addr
1419  he offset in vm_file corresponding to vm_start = Offset (within vm_file) in PAGE_SIZEunits += npages
1422  If Function pointers to deal with this struct. && open Then open(new)
1425  delete a VMA from its owning mm_struct and address space
1426  lock for writing
1427  delete a region from the global tree
1428  If new_below Then
1429  vm_start = Our start address within vm_mm. = addr
1430  vm_pgoff = Offset (within vm_file) in PAGE_SIZEunits += npages
1431  Else
1432  vm_end = The first byte after our end addresswithin vm_mm. = addr
1433  vm_top = addr
1435  add a region into the global tree
1436  add a region into the global tree
1437  lease a write lock
1438  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
1439  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
1440  Return 0
Caller
NameDescribe
do_munmaplease a mapping* - under NOMMU conditions the chunk to be unmapped must be backed by a single* VMA, though it need not cover the whole VMA
mlock_fixupmlock_fixup - handle mlock[all]/munlock[all] requests.* Filters out "special" vmas -- VM_LOCKED never gets set for these, and* munlock is a no-op. However, for some special vmas, we go ahead and* populate the ptes.