函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:copy_huge_page_from_user

函数原型:long copy_huge_page_from_user(struct page *dst_page, const void __user *usr_src, unsigned int pages_per_huge_page, bool allow_pagefault)

返回类型:long

参数:

类型参数名称
struct page *dst_page
const void __user *usr_src
unsigned intpages_per_huge_page
boolallow_pagefault
4768  src等于usr_src
4770  rc等于0
4771  ret_val等于pages_per_huge_pagePAGE_SIZE
4773 i小于pages_per_huge_page循环
4774  如果allow_pagefaultpage_kaddr等于kmap(dst_page + i)
4776  否则page_kaddr等于kmap_atomic(dst_page + i)
4778  rc等于copy_from_user(page_kaddr, (constvoid__user * )(src + i * PAGE_SIZE), PAGE_SIZE)
4781  如果allow_pagefaultkunmap(dst_page + i)
4783  否则Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(page_kaddr)
4786  ret_val减等于PAGE_SIZErc
4787  如果rc退出
4790  cond_resched()
4792  返回:ret_val
调用者
名称描述
hugetlb_mcopy_atomic_pteUsed by userfaultfd UFFDIO_COPY. Based on mcopy_atomic_pte with* modifications for huge pages.
__mcopy_atomic_hugetlb__mcopy_atomic processing for HUGETLB vmas. Note that this routine is* called with mmap_sem held, it will release mmap_sem before returning.