Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:lay_file_read_start_pos - find the first available byte to read*@read_pos: file read position*@buf: relay channel buffer* If the @read_pos is in the middle of padding, return the* position of the first actually available byte, otherwise

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

Type:size_t

Parameter:

TypeParameterName
size_tread_pos
struct rchan_buf *buf
1073  subbuf_size = sub-buffer size
1074  n_subbufs = number of sub-buffers per buffer
1075  consumed = count of sub-buffers consumed % n_subbufs
1077  If Not read_pos Then read_pos = consumed * subbuf_size + ytes consumed in cur read subbuf
1079  read_subbuf = read_pos / subbuf_size
1080  padding = padding counts per sub-buffer [read_subbuf]
1081  padding_start = (read_subbuf + 1) * subbuf_size - padding
1082  padding_end = (read_subbuf + 1) * subbuf_size
1083  If read_pos >= padding_start && read_pos < padding_end Then
1084  read_subbuf = (read_subbuf + 1) % n_subbufs
1085  read_pos = read_subbuf * subbuf_size
1088  Return read_pos
Caller
NameDescribe
relay_file_read