Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:splice_direct_to_actor - splices data directly between two non-pipes*@in: file to splice from*@sd: actor information on where to splice to*@actor: handles the data splicing* Description:* This is a special case helper to splice directly between two

Proto:ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, splice_direct_actor *actor)

Type:ssize_t

Parameter:

TypeParameterName
struct file *in
struct splice_desc *sd
splice_direct_actor *actor
922  i_mode = i_mode
923  If Value for the false possibility is greater at compile time(!S_ISREG(i_mode) && !S_ISBLK(i_mode)) Then Return -EINVAL
930  pipe = splice_pipe
931  If Value for the false possibility is greater at compile time(!pipe) Then
932  pipe = alloc_pipe_info()
933  If Not pipe Then Return -ENOMEM
941  readers = 1
943  splice_pipe = pipe
949  ret = 0
950  bytes = 0
951  len = maining length
952  flags = splice flags
957  splice flags &= ~don't block on the pipe splicing (but
958  more = splice flags & xpect more data
960  WARN_ON_ONCE(!pipe_empty - Return true if the pipe is empty*@head: The pipe ring head pointer*@tail: The pipe ring tail pointer)
962  When len cycle
965  pos = le position , prev_pos = pos
968  p_space = max_usage - pipe_occupancy - Return number of slots used in the pipe*@head: The pipe ring head pointer*@tail: The pipe ring tail pointer
970  read_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, p_space << PAGE_SHIFT determines the page size )
971  ret = Attempt to initiate a splice from a file to a pipe.
972  If Value for the false possibility is greater at compile time(ret <= 0) Then Go to out_release
975  read_len = ret
976  maining length = read_len
983  If read_len < len Then splice flags |= xpect more data
985  Else if Not more Then splice flags &= ~xpect more data
992  ret = actor(pipe, sd)
995  Go to out_release
998  bytes += ret
999  len -= ret
1000  le position = pos
1002  If ret < read_len Then
1004  Go to out_release
1008  done :
1009  tail = head = 0
1010  file_accessed(in)
1011  Return bytes
1013  out_release :
1018  When i < ring_size cycle
1019  buf = bufs[i]
1021  If ops Then pipe_buf_release - put a reference to a pipe_buffer*@pipe: the pipe that the buffer belongs to*@buf: the buffer to put a reference to
1025  If Not bytes Then bytes = ret
1028  Go to done
Caller
NameDescribe
do_splice_directdo_splice_direct - splices data directly between two files*@in: file to splice from*@ppos: input file offset*@out: file to splice to*@opos: output file offset*@len: number of bytes to splice*@flags: splice modifier flags* Description: