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:splice_pipe_to_pipe

Proto:static int splice_pipe_to_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
1544  ret = 0
1545  bool input_wakeup = false
1548  retry :
1549  ret = Make sure there's data to read. Wait for input if we can, otherwise* return an appropriate error.
1550  If ret Then Return ret
1553  ret = Make sure there's writeable room. Wait for room if we can, otherwise* return an appropriate error.
1554  If ret Then Return ret
1562  pipe_double_lock(ipipe, opipe)
1564  i_tail = tail
1565  i_mask = ring_size - 1
1566  o_head = head
1567  o_mask = ring_size - 1
1569  Do
1572  If Not readers Then
1574  If Not ret Then ret = -EPIPE
1576  Break
1579  i_head = head
1580  o_tail = tail
1582  If pipe_empty - Return true if the pipe is empty*@head: The pipe ring head pointer*@tail: The pipe ring tail pointer && Not writers Then Break
1592  If ret Then Break
1596  ret = -EAGAIN
1597  Break
1605  pipe_unlock(ipipe)
1606  pipe_unlock(opipe)
1607  Go to retry
1610  ibuf = bufs[i_tail & i_mask]
1611  obuf = bufs[o_head & o_mask]
1613  If len >= len Then
1617  obuf = ibuf
1618  ops = NULL
1619  i_tail++
1620  tail = i_tail
1621  input_wakeup = true
1622  o_len = len
1623  o_head++
1624  head = o_head
1625  Else
1631  If ret == 0 Then ret = -EFAULT
1633  Break
1635  obuf = ibuf
1645  len = len
1646  offset += len
1647  len -= len
1648  o_len = len
1649  o_head++
1650  head = o_head
1652  ret += o_len
1653  len -= o_len
1654  When len cycle
1656  pipe_unlock(ipipe)
1657  pipe_unlock(opipe)
1662  If ret > 0 Then wakeup_pipe_readers(opipe)
1665  If input_wakeup Then wakeup_pipe_writers(ipipe)
1668  Return ret
Caller
NameDescribe
do_spliceDetermine where to splice to/from.