函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Attach vma to its own anon_vma, as well as to the anon_vmas that* the corresponding VMA in the parent process is attached to.* Returns 0 on success, non-zero on failure.

函数原型:int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma)

返回类型:int

参数:

类型参数名称
struct vm_area_struct *vma
struct vm_area_struct *pvma
342  如果非Serialized by page_table_lock 则返回:0
346  Serialized by page_table_lock = NULL
352  error等于Attach the anon_vmas from src to dst
353  如果error则返回:error
357  如果Serialized by page_table_lock 则返回:0
361  anon_vma等于anon_vma_alloc()
362  如果非anon_vma则转到:out_error
364  avc等于anon_vma_chain_alloc(GFP_KERNEL)
365  如果非avc则转到:out_error_free_anon_vma
372  Root of this anon_vma tree 等于root
373  Parent of this anon_vma 等于Serialized by page_table_lock
379  get_anon_vma(Root of this anon_vma tree )
381  Serialized by page_table_lock 等于anon_vma
382  anon_vma_lock_write(anon_vma)
383  anon_vma_chain_link(vma, avc, anon_vma)
384  Count of child anon_vmas and VMAs which points to this anon_vma.* This counter is used for making decision about reusing anon_vma* instead of forking new one. See comments in function anon_vma_clone.自加
385  anon_vma_unlock_write(anon_vma)
387  返回:0
389  out_error_free_anon_vma :
390  put_anon_vma(anon_vma)
391  out_error :
392  unlink_anon_vmas(vma)
393  返回:负ENOMEM
调用者
名称描述
dup_mmap