函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:get_user_pages_fast() - pin user pages in memory*@start: starting user address*@nr_pages: number of pages from start to pin*@gup_flags: flags modifying pin behaviour*@pages: array that receives pointers to the pages pinned.

函数原型:int get_user_pages_fast(unsigned long start, int nr_pages, unsigned int gup_flags, struct page **pages)

返回类型:int

参数:

类型参数名称
unsigned longstart
intnr_pages
unsigned intgup_flags
struct page **pages
2416  nr等于0, ret等于0
2418  如果WARN_ON_ONCE(gup_flags & ~(check pte is writable | mapping lifetime is indefinite: see below | get_user_pages read/write w/o permission ))则返回:负EINVAL
2422  start等于Architectures that support memory tagging (assigning tags to memory regions,* embedding these tags into addresses that point to these memory regions, and* checking that the memory and the pointer tags match on memory accesses)(start)按位与PAGE_MASK
2423  addr等于start
2424  len等于nr_pages左移PAGE_SHIFT determines the page size
2425  end等于startlen
2427  如果end小于等于start则返回:0
2429  如果此条件成立可能性小(为编译器优化)(!access_ok - Checks if a user space pointer is valid*@addr: User space pointer to start of block to check*@size: Size of block to check* Context: User context only. This function may sleep if pagefaults are* enabled.((void__user * )start, len))则返回:负EFAULT
2432  如果IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_HAVE_FAST_GUP)且Check if it's allowed to use __get_user_pages_fast() for the range, or* we need to fall back to the slow version:
2434  禁止中断()
2435  gup_pgd_range(addr, end, gup_flags, pages, & nr)
2436  开中断()
2437  ret等于nr
2440  如果nr小于nr_pages
2442  start加等于nr左移PAGE_SHIFT determines the page size
2443  pages加等于nr
2445  ret等于__gup_longterm_unlocked(start, nr_pages - nr, gup_flags, pages)
2449  如果nr大于0则
2450  如果ret小于0则ret等于nr
2452  否则ret加等于nr
2457  返回:ret
调用者
名称描述
iov_iter_get_pages_alloc
get_futex_keyget_futex_key() - Get parameters which are the keys for a futex*@uaddr: virtual address of the futex*@fshared: 0 for a PROCESS_PRIVATE futex, 1 for PROCESS_SHARED*@key: address where result is stored
madvise_inject_errorError injection support for memory error handling.
__gup_benchmark_ioctl
iov_iter_get_pages