函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\pipe.c Create Date:2022-07-29 10:34:16
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:pipe_read

函数原型:static ssize_t pipe_read(struct kiocb *iocb, struct iov_iter *to)

返回类型:ssize_t

参数:

类型参数名称
struct kiocb *iocb
struct iov_iter *to
286  total_len等于iov_iter_count(to)
287  filp等于文件指针
288  pipe等于 needed for tty driver, and maybe others
293  如果此条件成立可能性小(为编译器优化)(total_len == 0)则返回:0
296  ret等于0
297  __pipe_lock(pipe)
307  was_full等于pipe_full - Return true if the pipe is full*@head: The pipe ring head pointer*@tail: The pipe ring tail pointer*@limit: The maximum amount of slots available.
308  循环
309  head等于head
310  tail等于tail
311  mask等于ring_size减1
314  buf等于bufs[tail & mask]
315  chars等于len
319  如果chars大于total_lenchars等于total_len
323  如果error
324  如果非retret等于error
326  退出
331  如果非retret等于负EFAULT
333  退出
335  ret加等于chars
336  offset加等于chars
337  len减等于chars
340  如果flags按位与ad() as a packet
341  total_len等于chars
342  len等于0
345  如果非len
352  total_len减等于chars
353  如果非total_len退出
359  如果非writers退出
361  如果ret退出
363  如果f_flags按位与O_NONBLOCK
364  ret等于负EAGAIN
365  退出
367  __pipe_unlock(pipe)
397  如果wait_event_interruptible - sleep until a condition gets true*@wq_head: the waitqueue to wait on*@condition: a C expression for the event to wait for* The process is put to sleep (TASK_INTERRUPTIBLE) until the(wait, Done while waiting without holding the pipe lock - thus the READ_ONCE() )小于0则返回:负These should never be seen by user programs. To return one of ERESTART** codes, signal_pending() MUST be set. Note that ptrace can observe these* at syscall exit tracing, but they will never be left for the debugged user* process to see.
400  __pipe_lock(pipe)
401  was_full等于pipe_full - Return true if the pipe is full*@head: The pipe ring head pointer*@tail: The pipe ring tail pointer*@limit: The maximum amount of slots available.
403  __pipe_unlock(pipe)
405  如果was_full
406  wake_up_interruptible_sync_poll( & wait, EPOLLOUT | EPOLLWRNORM)
407  an be called from interrupts
409  如果ret大于0则file_accessed(filp)
411  返回:ret