函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\relay.c Create Date:2022-07-27 12:52:31
Last Modify:2020-03-17 19:20:22 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:subbuf_splice_actor - splice up to one subbuf's worth of data

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

返回类型:ssize_t

参数:

类型参数名称
struct file *in
loff_t *ppos
struct pipe_inode_info *pipe
size_tlen
unsigned intflags
int *nonpad_ret
1201  rbuf等于 needed for tty driver, and maybe others
1202  subbuf_size等于 sub-buffer size
1203  uint64_t pos = (uint64_t) * ppos
1204  alloc_size等于 total buffer size allocated
1205  read_start等于do_div() is NOT a C function(pos, alloc_size)
1206  read_subbuf等于read_startsubbuf_size
1207  padding等于padding counts per sub-buffer [read_subbuf]
1208  nonpad_end等于read_subbufsubbuf_sizesubbuf_sizepadding
1211  struct splice_pipe_desc spd = {page map = pages, umber of populated pages in map = 0, pages[] & partial[] arrays size = PIPE_DEF_BUFFERS, pages[] may not be contig = partial, ps associated with output pipe = & relay_pipe_buf_ops, spd_release = relay_page_release, }
1221  如果count of sub-buffers produced 恒等于count of sub-buffers consumed 则返回:0
1223  如果r dynamic pipe sizing则返回:负ENOMEM
1229  如果len大于subbuf_sizeread_start取模subbuf_sizelen等于subbuf_sizeread_start取模subbuf_size
1232  subbuf_pages等于 total buffer size allocated 右移PAGE_SHIFT determines the page size
1233  pidx等于read_startPAGE_SIZE取模subbuf_pages
1234  poff等于read_start按位与PAGE_MASK的反
1235  nr_pages等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(unsignedint, subbuf_pages, pages[] & partial[] arrays size )
1237 umber of populated pages in map 小于nr_pages循环
1239  cur_pos等于read_starttotal_len
1241  如果非len退出
1244  this_len等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(unsignedlong, len, PAGE_SIZE - poff)
1245  private等于this_len
1247  page map [umber of populated pages in map ]等于array of current buffer pages [pidx]
1248  offset等于poff
1250  this_end等于cur_posthis_len
1251  如果this_end大于等于nonpad_end
1252  this_len等于nonpad_endcur_pos
1253  private等于this_lenpadding
1255  len等于this_len
1256  private等于private
1258  len减等于this_len
1259  total_len加等于this_len
1260  poff等于0
1261  pidx等于pidx加1的和取模subbuf_pages
1263  如果this_end大于等于nonpad_end
1265  退出
1269  ret等于0
1270  如果非umber of populated pages in map 则转到:out
1273  ret等于nonpad_ret等于splice_to_pipe - fill passed data into a pipe*@pipe: pipe to fill*@spd: data to fill* Description:*@spd contains a map of pages and len/offset tuples, along with* the struct pipe_buf_operations associated with these pages. This
1274  如果ret小于0或ret小于total_len则转到:out
1277  如果read_startret恒等于nonpad_endret加等于padding
1280  out :
1281  splice_shrink_spd( & spd)
1282  返回:ret
调用者
名称描述
relay_file_splice_read