Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__split_vma() bypasses sysctl_max_map_count checking. We use this where it* has already been checked or doesn't make sense to fail.

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
2640  If Function pointers to deal with this struct. && split Then
2641  err = split(vma, addr)
2642  If err Then Return err
2646  new = vm_area_dup(vma)
2647  If Not new Then Return -ENOMEM
2650  If new_below Then The first byte after our end addresswithin vm_mm. = addr
2652  Else
2653  Our start address within vm_mm. = addr
2654  Offset (within vm_file) in PAGE_SIZEunits += addr - Our start address within vm_mm. >> PAGE_SHIFT determines the page size
2657  err = vma_dup_policy(vma, new)
2658  If err Then Go to out_free_vma
2661  err = anon_vma_clone(new, vma)
2662  If err Then Go to out_free_mpol
2665  If File we map to (can be NULL). Then get_file(File we map to (can be NULL). )
2668  If Function pointers to deal with this struct. && open Then open(new)
2671  If new_below Then err = vma_adjust(vma, addr, The first byte after our end addresswithin vm_mm. , Offset (within vm_file) in PAGE_SIZEunits + ((addr - Our start address within vm_mm. ) >> PAGE_SHIFT determines the page size ), new)
2674  Else err = vma_adjust(vma, Our start address within vm_mm. , addr, Offset (within vm_file) in PAGE_SIZEunits , new)
2678  If Not err Then Return 0
2682  If Function pointers to deal with this struct. && close Then close(new)
2684  If File we map to (can be NULL). Then fput(File we map to (can be NULL). )
2686  unlink_anon_vmas(new)
2687  out_free_mpol :
2688  mpol_put(vma_policy(new))
2689  out_free_vma :
2690  vm_area_free(new)
2691  Return err
Caller
NameDescribe
split_vmaSplit a vma into two pieces at address 'addr', a new vma is allocated* either for the first part or the tail.
__do_munmapMunmap is split into 2 main parts -- this part which finds* what needs doing, and the areas themselves, which do the* work. This now handles partial unmappings.* Jeremy Fitzhardinge
madvise_behaviorWe can potentially split a vm area into separate* areas, each area with its own behavior.