函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:default_file_splice_read

函数原型:static ssize_t default_file_splice_read(struct file *in, loff_t *ppos, struct pipe_inode_info *pipe, size_t len, unsigned int flags)

返回类型:ssize_t

参数:

类型参数名称
struct file *in
loff_t *ppos
struct pipe_inode_info *pipe
size_tlen
unsigned intflags
380  copied等于0
384  如果pipe_full - Return true if the pipe is full*@head: The pipe ring head pointer*@tail: The pipe ring tail pointer*@limit: The maximum amount of slots available.则返回:负EAGAIN
391  offset等于ppos按位与PAGE_MASK的反
393  iov_iter_pipe( & to, generic data direction definitions , pipe, len + offset)
395  res等于iov_iter_get_pages_alloc( & to, & pages, len + offset, & base)
396  如果res小于等于0则返回:负ENOMEM
399  nr_pages等于DIV_ROUND_UP(res + base, PAGE_SIZE)
401  vec等于__vec
402  如果nr_pages大于PIPE_DEF_BUFFERS
403  vec等于分配数组内存
405  res等于负ENOMEM
406  转到:out
410  mask等于ring_size减1
411  offset等于offset
412  len减等于offset
414 i小于nr_pages循环
415  this_len等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(size_t, len, PAGE_SIZE - offset)
416  and that should *never* hold a userland pointer 等于page_address(pages[i])加offset
417  iov_len等于this_len
418  len减等于this_len
419  offset等于0
422  res等于kernel_readv(in, vec, nr_pages, * ppos)
423  如果res大于0则
424  copied等于res
425  ppos加等于res
428  如果vec不等于__vec释放内存
430  out :
431 i小于nr_pages循环Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
433  kvfree() - Free memory.*@addr: Pointer to allocated memory.* kvfree frees memory allocated by any of vmalloc(), kmalloc() or kvmalloc().* It is slightly more efficient to use kfree() or vfree() if you are certain* that you know which one to use.
434  iov_iter_advance( & to, copied)
435  返回:res