函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:relay_file_read

函数原型:static ssize_t relay_file_read(struct file *filp, char __user *buffer, size_t count, loff_t *ppos)

返回类型:ssize_t

参数:

类型参数名称
struct file *filp
char __user *buffer
size_tcount
loff_t *ppos
1122  buf等于 needed for tty driver, and maybe others
1124  written等于0
1127  如果非count则返回:0
1130  inode_lock(file_inode(filp))
1131  循环
1134  如果非lay_file_read_avail - boolean, are there unconsumed bytes available?退出
1137  read_start等于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
1138  avail等于lay_file_read_subbuf_avail - return bytes available in sub-buffer*@read_pos: file read position*@buf: relay channel buffer
1139  如果非avail退出
1142  avail等于两数取小(count, avail)
1143  from等于start of channel buffer read_start
1144  ret等于avail
1145  如果copy_to_user(buffer, from, avail)则退出
1148  buffer加等于ret
1149  written加等于ret
1150  count减等于ret
1152  lay_file_read_consume - update the consumed count for the buffer
1153  ppos等于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
1154 count循环
1155  inode_unlock(file_inode(filp))
1157  返回:written