函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\process_vm_access.c Create Date:2022-07-27 16:31:15
Last Modify:2020-03-17 21:52:24 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:process_vm_rw_single_vec - read/write pages from task specified*@addr: start memory address of target process*@len: size of area to copy to/from*@iter: where to copy to/from locally*@process_pages: struct pages area that can store at least*

函数原型:static int process_vm_rw_single_vec(unsigned long addr, unsigned long len, struct iov_iter *iter, struct page **process_pages, struct mm_struct *mm, struct task_struct *task, int vm_write)

返回类型:int

参数:

类型参数名称
unsigned longaddr
unsigned longlen
struct iov_iter *iter
struct page **process_pages
struct mm_struct *mm
struct task_struct *task
intvm_write
82  pa等于addr按位与PAGE_MASK
83  start_offset等于addrpa
85  rc等于0
86  max_pages_per_loop等于Maximum number of pages kmalloc'd to hold struct page's during copy sizeof(structpages * )
88  flags等于0
91  如果len恒等于0则返回:0
93  nr_pages等于addrlen减1的差除PAGE_SIZEaddrPAGE_SIZE加1
95  如果vm_writeflags或等于check pte is writable
98  当非rcnr_pagesiov_iter_count(iter)循环
99  pages等于两数取小(nr_pages, max_pages_per_loop)
100  locked等于1
108  lock for reading
109  pages等于get_user_pages_remote() - pin user pages in memory*@tsk: the task_struct to use for page fault accounting, or* NULL if faults are not to be recorded
111  如果lockedlease a read lock
113  如果pages小于等于0则返回:负EFAULT
116  bytes等于pagesPAGE_SIZEstart_offset
117  如果bytes大于lenbytes等于len
120  rc等于process_vm_rw_pages - read/write pages from task specified*@pages: array of pointers to pages we want to copy*@offset: offset in page to start copying from/to*@len: number of bytes to copy*@iter: where to copy to/from locally*@vm_write: 0 means copy from,
123  len减等于bytes
124  start_offset等于0
125  nr_pages减等于pages
126  pa加等于pagesPAGE_SIZE
127 pages循环
128  put_page(process_pages[--pages])
131  返回:rc
调用者
名称描述
process_vm_rw_coreprocess_vm_rw_core - core of reading/writing pages from task specified*@pid: PID of process to read/write from/to*@iter: where to copy to/from locally*@rvec: iovec array specifying where to copy to/from in the other process*@riovcnt: size of rvec