Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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.

Proto:int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma)

Type:int

Parameter:

TypeParameterName
struct vm_area_struct *vma
struct vm_area_struct *pvma
342  If Not Serialized by page_table_lock Then Return 0
346  Serialized by page_table_lock = NULL
352  error = Attach the anon_vmas from src to dst
353  If error Then Return error
357  If Serialized by page_table_lock Then Return 0
361  anon_vma = anon_vma_alloc()
362  If Not anon_vma Then Go to out_error
364  avc = anon_vma_chain_alloc(GFP_KERNEL)
365  If Not avc Then Go to 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  Return 0
389  out_error_free_anon_vma :
390  put_anon_vma(anon_vma)
391  out_error :
392  unlink_anon_vmas(vma)
393  Return -ENOMEM
Caller
NameDescribe
dup_mmap