Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\relay.c Create Date:2022-07-28 11:47:29
Last Modify:2020-03-17 19:20:22 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:lay_file_read_end_pos - return the new read position*@read_pos: file read position*@buf: relay channel buffer*@count: number of bytes to be read

Proto:static size_t relay_file_read_end_pos(struct rchan_buf *buf, size_t read_pos, size_t count)

Type:size_t

Parameter:

TypeParameterName
struct rchan_buf *buf
size_tread_pos
size_tcount
1102  subbuf_size = sub-buffer size
1103  n_subbufs = number of sub-buffers per buffer
1105  read_subbuf = read_pos / subbuf_size
1106  padding = padding counts per sub-buffer [read_subbuf]
1107  If read_pos % subbuf_size + count + padding == subbuf_size Then end_pos = (read_subbuf + 1) * subbuf_size
1109  Else end_pos = read_pos + count
1111  If end_pos >= subbuf_size * n_subbufs Then end_pos = 0
1114  Return end_pos
Caller
NameDescribe
relay_file_read