函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:fifo_open

函数原型:static int fifo_open(struct inode *inode, struct file *filp)

返回类型:int

参数:

类型参数名称
struct inode *inode
struct file *filp
1016  is_pipe等于s_magic恒等于PIPEFS_MAGIC
1019  f_version等于0
1021  加自旋锁
1022  如果i_pipe
1023  pipe等于i_pipe
1024  files自加
1025  自旋锁解锁
1026  否则
1027  自旋锁解锁
1028  pipe等于alloc_pipe_info()
1029  如果非pipe则返回:负ENOMEM
1031  files等于1
1032  加自旋锁
1034  files自加
1037  pipe等于i_pipe
1038  否则
1039  i_pipe等于pipe
1043  needed for tty driver, and maybe others 等于pipe
1046  __pipe_lock(pipe)
1049  stream_open is used by subsystems that want stream-like file descriptors.* Such file descriptors are not seekable and don't have notion of position* (file.f_pos is always 0 and ppos passed to .read()/.write() is always NULL).
1052  : & == le is open for reading
1058  r_counter自加
1059  如果readers自加恒等于0则wake_up_partner(pipe)
1062  如果非is_pipe且非writers
1063  如果f_flags按位与O_NONBLOCK
1066  f_version等于w_counter
1067  否则
1068  如果wait_for_partner(pipe, & w_counter)则转到:err_rd
1072  退出
1074  : & == le is open for writing
1080  ret等于负ENXIO
1081  如果非is_pipef_flags按位与O_NONBLOCK且非readers则转到:err
1084  w_counter自加
1085  如果非writers自加则wake_up_partner(pipe)
1088  如果非is_pipe且非readers
1089  如果wait_for_partner(pipe, & r_counter)则转到:err_wr
1092  退出
1094  : & == le is open for reading | le is open for writing
1102  readers自加
1103  writers自加
1104  r_counter自加
1105  w_counter自加
1106  如果readers恒等于1或writers恒等于1则wake_up_partner(pipe)
1108  退出
1110  默认
1111  ret等于负EINVAL
1112  转到:err
1116  __pipe_unlock(pipe)
1117  返回:0
1119  err_rd :
1120  如果非readers先自减则wake_up_interruptible( & wait)
1122  ret等于负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.
1123  转到:err
1125  err_wr :
1126  如果非writers先自减则wake_up_interruptible( & wait)
1128  ret等于负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.
1129  转到:err
1131  err :
1132  __pipe_unlock(pipe)
1134  put_pipe_info(inode, pipe)
1135  返回:ret