Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:lay_file_read_consume - update the consumed count for the buffer

Proto:static void relay_file_read_consume(struct rchan_buf *buf, size_t read_pos, size_t bytes_consumed)

Type:void

Parameter:

TypeParameterName
struct rchan_buf *buf
size_tread_pos
size_tbytes_consumed
964  subbuf_size = sub-buffer size
965  n_subbufs = number of sub-buffers per buffer
968  If count of sub-buffers produced == count of sub-buffers consumed && current offset into sub-buffer == ytes consumed in cur read subbuf Then Return
972  If ytes consumed in cur read subbuf + bytes_consumed > subbuf_size Then
973  lay_subbufs_consumed - update the buffer's sub-buffers-consumed count*@chan: the channel*@cpu: the cpu associated with the channel buffer to update*@subbufs_consumed: number of sub-buffers to add to current buf's count
974  ytes consumed in cur read subbuf = 0
977  ytes consumed in cur read subbuf += bytes_consumed
978  If Not read_pos Then read_subbuf = count of sub-buffers consumed % n_subbufs
980  Else read_subbuf = read_pos / sub-buffer size
982  If ytes consumed in cur read subbuf + padding counts per sub-buffer [read_subbuf] == subbuf_size Then
983  If read_subbuf == count of sub-buffers produced % n_subbufs && current offset into sub-buffer == subbuf_size Then Return
986  lay_subbufs_consumed - update the buffer's sub-buffers-consumed count*@chan: the channel*@cpu: the cpu associated with the channel buffer to update*@subbufs_consumed: number of sub-buffers to add to current buf's count
987  ytes consumed in cur read subbuf = 0
Caller
NameDescribe
relay_file_read_availlay_file_read_avail - boolean, are there unconsumed bytes available?
relay_file_read