Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\splice.c Create Date:2022-07-28 20:11:29
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Link contents of ipipe to opipe.

Proto:static int link_pipe(struct pipe_inode_info *ipipe, struct pipe_inode_info *opipe, size_t len, unsigned int flags)

Type:int

Parameter:

TypeParameterName
struct pipe_inode_info *ipipe
struct pipe_inode_info *opipe
size_tlen
unsigned intflags
1682  ret = 0
1689  pipe_double_lock(ipipe, opipe)
1691  i_tail = tail
1692  i_mask = ring_size - 1
1693  o_head = head
1694  o_mask = ring_size - 1
1696  Do
1697  If Not readers Then
1699  If Not ret Then ret = -EPIPE
1701  Break
1704  i_head = head
1705  o_tail = tail
1711  If pipe_empty - Return true if the pipe is empty*@head: The pipe ring head pointer*@tail: The pipe ring tail pointer || 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. Then Break
1715  ibuf = bufs[i_tail & i_mask]
1716  obuf = bufs[o_head & o_mask]
1723  If ret == 0 Then ret = -EFAULT
1725  Break
1728  obuf = ibuf
1734  flags &= ~page is a gift
1736  pipe_buf_mark_unmergeable - mark a &struct pipe_buffer as unmergeable*@buf: the buffer to mark* Description:* This function ensures that no future writes will be merged into the* given &struct pipe_buffer. This is necessary when multiple pipe buffers
1738  If len > len Then len = len
1740  ret += len
1741  len -= len
1743  o_head++
1744  head = o_head
1745  i_tail++
1746  When len cycle
1748  pipe_unlock(ipipe)
1749  pipe_unlock(opipe)
1754  If ret > 0 Then wakeup_pipe_readers(opipe)
1757  Return ret
Caller
NameDescribe
do_teeThis is a tee(1) implementation that works on pipes. It doesn't copy* any data, it simply references the 'in' pages on the 'out' pipe.* The 'flags' used are the SPLICE_F_* variants, currently the only* applicable one is SPLICE_F_NONBLOCK.