函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Determine where to splice to/from.

函数原型:static long do_splice(struct file *in, loff_t __user *off_in, struct file *out, loff_t __user *off_out, size_t len, unsigned int flags)

返回类型:long

参数:

类型参数名称
struct file *in
loff_t __user *off_in
struct file *out
loff_t __user *off_out
size_tlen
unsigned intflags
1121  ipipe等于After the inode slimming patch, i_pipe/i_bdev/i_cdev share the same* location, so checking ->i_pipe is not enough to verify that this is a* pipe.
1122  opipe等于After the inode slimming patch, i_pipe/i_bdev/i_cdev share the same* location, so checking ->i_pipe is not enough to verify that this is a* pipe.
1124  如果ipipeopipe
1125  如果off_inoff_out则返回:负ESPIPE
1128  如果非f_mode按位与le is open for reading 的值则返回:负EBADF
1131  如果非f_mode按位与le is open for writing 的值则返回:负EBADF
1135  如果ipipe恒等于opipe则返回:负EINVAL
1138  如果f_flags按位或f_flags的值按位与O_NONBLOCKflags或等于don't block on the pipe splicing (but
1141  返回:splice_pipe_to_pipe(ipipe, opipe, len, flags)
1144  如果ipipe
1145  如果off_in则返回:负ESPIPE
1147  如果off_out
1148  如果非f_mode按位与le can be accessed using pwrite 的值则返回:负EINVAL
1150  如果copy_from_user( & offset, off_out, sizeof(loff_t))则返回:负EFAULT
1152  否则
1153  offset等于f_pos
1156  如果此条件成立可能性小(为编译器优化)(!(f_mode & le is open for writing ))则返回:负EBADF
1159  如果此条件成立可能性小(为编译器优化)(f_flags & O_APPEND)则返回:负EINVAL
1162  ret等于rw_verify_area(WRITE, out, & offset, len)
1163  如果此条件成立可能性小(为编译器优化)(ret < 0)则返回:ret
1166  如果f_flags按位与O_NONBLOCKflags或等于don't block on the pipe splicing (but
1169  file_start_write(out)
1170  ret等于Attempt to initiate a splice from pipe to file.
1171  file_end_write(out)
1173  如果非off_outf_pos等于offset
1175  否则如果copy_to_user(off_out, & offset, sizeof(loff_t))则ret等于负EFAULT
1178  返回:ret
1181  如果opipe
1182  如果off_out则返回:负ESPIPE
1184  如果off_in
1185  如果非f_mode按位与le can be accessed using pread 的值则返回:负EINVAL
1187  如果copy_from_user( & offset, off_in, sizeof(loff_t))则返回:负EFAULT
1189  否则
1190  offset等于f_pos
1193  如果f_flags按位与O_NONBLOCKflags或等于don't block on the pipe splicing (but
1196  pipe_lock(opipe)
1197  ret等于wait_for_space(opipe, flags)
1198  如果非ret
1207  pipe_unlock(opipe)
1208  如果ret大于0则wakeup_pipe_readers(opipe)
1210  如果非off_inf_pos等于offset
1212  否则如果copy_to_user(off_in, & offset, sizeof(loff_t))则ret等于负EFAULT
1215  返回:ret
1218  返回:负EINVAL
调用者
名称描述
SYSCALL_DEFINE6