函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, int new_below)

返回类型:int

参数:

类型参数名称
struct mm_struct *mm
struct vm_area_struct *vma
unsigned longaddr
intnew_below
2640  如果Function pointers to deal with this struct. split
2641  err等于split(vma, addr)
2642  如果err则返回:err
2646  new等于vm_area_dup(vma)
2647  如果非new则返回:负ENOMEM
2650  如果new_belowThe first byte after our end addresswithin vm_mm. 等于addr
2652  否则
2653  Our start address within vm_mm. 等于addr
2654  Offset (within vm_file) in PAGE_SIZEunits 加等于addrOur start address within vm_mm. 右移PAGE_SHIFT determines the page size
2657  err等于vma_dup_policy(vma, new)
2658  如果err则转到:out_free_vma
2661  err等于anon_vma_clone(new, vma)
2662  如果err则转到:out_free_mpol
2665  如果File we map to (can be NULL). get_file(File we map to (can be NULL). )
2668  如果Function pointers to deal with this struct. openopen(new)
2671  如果new_belowerr等于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  否则err等于vma_adjust(vma, Our start address within vm_mm. , addr, Offset (within vm_file) in PAGE_SIZEunits , new)
2678  如果非err则返回:0
2682  如果Function pointers to deal with this struct. closeclose(new)
2684  如果File we map to (can be NULL). 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  返回:err
调用者
名称描述
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.