函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__anon_vma_prepare - attach an anon_vma to a memory region*@vma: the memory region in question* This makes sure the memory mapping described by 'vma' has* an 'anon_vma' attached to it, so that we can associate the

函数原型:int __anon_vma_prepare(struct vm_area_struct *vma)

返回类型:int

参数:

类型参数名称
struct vm_area_struct *vma
178  mm等于The address space we belong to.
182  might_sleep()
184  avc等于anon_vma_chain_alloc(GFP_KERNEL)
185  如果非avc则转到:out_enomem
188  anon_vma等于d_mergeable_anon_vma is used by anon_vma_prepare, to check* neighbouring vmas for a suitable anon_vma, before it goes off* to allocate a new anon_vma
189  allocated = NULL
190  如果非anon_vma
191  anon_vma等于anon_vma_alloc()
192  如果此条件成立可能性小(为编译器优化)(!anon_vma)则转到:out_enomem_free_avc
194  allocated等于anon_vma
197  anon_vma_lock_write(anon_vma)
199  加自旋锁
200  如果此条件成立可能性大(为编译器优化)(!Serialized by page_table_lock )则
201  Serialized by page_table_lock 等于anon_vma
202  anon_vma_chain_link(vma, avc, anon_vma)
204  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.自加
205  allocated = NULL
206  avc = NULL
208  自旋锁解锁
209  anon_vma_unlock_write(anon_vma)
211  如果此条件成立可能性小(为编译器优化)(allocated)则put_anon_vma(allocated)
213  如果此条件成立可能性小(为编译器优化)(avc)则anon_vma_chain_free(avc)
216  返回:0
218  out_enomem_free_avc :
219  anon_vma_chain_free(avc)
220  out_enomem :
221  返回:负ENOMEM
调用者
名称描述
anon_vma_prepare