函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\relay.c Create Date:2022-07-27 12:52:13
Last Modify:2020-03-17 19:20:22 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:lay_file_read_avail - boolean, are there unconsumed bytes available?

函数原型:static int relay_file_read_avail(struct rchan_buf *buf, size_t read_pos)

返回类型:int

参数:

类型参数名称
struct rchan_buf *buf
size_tread_pos
996  subbuf_size等于 sub-buffer size
997  n_subbufs等于 number of sub-buffers per buffer
998  produced等于count of sub-buffers produced
999  consumed等于count of sub-buffers consumed
1001  lay_file_read_consume - update the consumed count for the buffer
1003  consumed等于count of sub-buffers consumed
1005  如果此条件成立可能性小(为编译器优化)(current offset into sub-buffer > subbuf_size)则
1006  如果produced恒等于consumed则返回:0
1008  返回:1
1011  如果此条件成立可能性小(为编译器优化)(produced - consumed >= n_subbufs)则
1012  consumed等于producedn_subbufs加1
1013  count of sub-buffers consumed 等于consumed
1014  ytes consumed in cur read subbuf 等于0
1017  produced等于produced取模n_subbufssubbuf_sizecurrent offset into sub-buffer
1018  consumed等于consumed取模n_subbufssubbuf_sizeytes consumed in cur read subbuf
1020  如果consumed大于producedproduced加等于n_subbufssubbuf_size
1023  如果consumed恒等于produced
1024  如果current offset into sub-buffer 恒等于subbuf_sizecount of sub-buffers produced 大于count of sub-buffers consumed 则返回:1
1027  返回:0
1030  返回:1
调用者
名称描述
relay_file_read