函数逻辑报告 |
Source Code:mm\userfaultfd.c |
Create Date:2022-07-27 18:09:12 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:__mcopy_atomic processing for HUGETLB vmas. Note that this routine is* called with mmap_sem held, it will release mmap_sem before returning.
函数原型:static __always_inline ssize_t __mcopy_atomic_hugetlb(struct mm_struct *dst_mm, struct vm_area_struct *dst_vma, unsigned long dst_start, unsigned long src_start, unsigned long len, bool zeropage)
返回类型:ssize_t
参数:
类型 | 参数 | 名称 |
---|---|---|
struct mm_struct * | dst_mm | |
struct vm_area_struct * | dst_vma | |
unsigned long | dst_start | |
unsigned long | src_start | |
unsigned long | len | |
bool | zeropage |
210 | vm_alloc_shared等于Flags, see mm.h. 按位与VM_SHARED |
211 | vm_shared等于Flags, see mm.h. 按位与VM_SHARED |
228 | 如果zeropage则 |
230 | 返回:负EINVAL |
235 | copied等于0 |
236 | page = NULL |
237 | vma_hpagesize等于Return the size of the pages allocated when backing a VMA. In the majority* cases this will be same size as used by the page table entries. |
243 | 如果dst_start按位与vma_hpagesize减1或len按位与vma_hpagesize减1则转到:out_unlock |
246 | retry : |
251 | 如果非dst_vma则 |
253 | dst_vma等于find_dst_vma(dst_mm, dst_start, len) |
254 | 如果非dst_vma或非is_vm_hugetlb_page(dst_vma)则转到:out_unlock |
258 | 如果vma_hpagesize不等于Return the size of the pages allocated when backing a VMA. In the majority* cases this will be same size as used by the page table entries.则转到:out_unlock |
261 | vm_shared等于Flags, see mm.h. 按位与VM_SHARED |
268 | 如果非vm_shared则 |
269 | 如果此条件成立可能性小(为编译器优化)(anon_vma_prepare(dst_vma))则转到:out_unlock |
281 | idx等于linear_page_index(dst_vma, dst_addr) |
283 | hash等于For uniprocesor systems we always use a single mutex, so just* return 0 and avoid the hashing overhead. |
284 | mutex_lock( & hugetlb_fault_mutex_table[hash]) |
287 | dst_pte等于arch callbacks |
288 | 如果非dst_pte则 |
290 | 转到:out_unlock |
294 | dst_pteval等于huge_ptep_get(dst_pte) |
295 | 如果非huge_pte_none(dst_pteval)则 |
297 | 转到:out_unlock |
300 | err等于Used by userfaultfd UFFDIO_COPY. Based on mcopy_atomic_pte with* modifications for huge pages. |
304 | vm_alloc_shared等于vm_shared |
306 | cond_resched() |
308 | 如果此条件成立可能性小(为编译器优化)(err == - ENOENT)则 |
312 | err等于copy_huge_page_from_user(page, (constvoid__user * )src_addr, vma_hpagesize / PAGE_SIZE, true) |
316 | 如果此条件成立可能性小(为编译器优化)(err)则 |
320 | lock for reading |
322 | dst_vma = NULL |
323 | 转到:retry |
327 | 如果非err则 |
328 | dst_addr加等于vma_hpagesize |
329 | src_addr加等于vma_hpagesize |
330 | copied加等于vma_hpagesize |
332 | 如果fatal_signal_pending(当前进程)则err等于负EINTR |
339 | out_unlock : |
341 | out : |
342 | 如果page则 |
名称 | 描述 |
---|---|
__mcopy_atomic |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |