函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:do_sendfile

函数原型:static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, size_t count, loff_t max)

返回类型:ssize_t

参数:

类型参数名称
intout_fd
intin_fd
loff_t *ppos
size_tcount
loff_tmax
1406  retval等于负EBADF
1407  in等于fdget(in_fd)
1408  如果非file则转到:out
1410  如果非f_mode按位与le is open for reading 的值则转到:fput_in
1412  retval等于负ESPIPE
1413  如果非ppos
1414  pos等于f_pos
1415  否则
1416  pos等于ppos
1417  如果非f_mode按位与le can be accessed using pread 的值则转到:fput_in
1420  retval等于rw_verify_area(generic data direction definitions , file, & pos, count)
1421  如果retval小于0则转到:fput_in
1423  如果count大于MAX_RW_COUNTcount等于MAX_RW_COUNT
1429  retval等于负EBADF
1430  out等于fdget(out_fd)
1431  如果非file则转到:fput_in
1433  如果非f_mode按位与le is open for writing 的值则转到:fput_out
1435  in_inode等于file_inode(file)
1436  out_inode等于file_inode(file)
1437  out_pos等于f_pos
1438  retval等于rw_verify_area(WRITE, file, & out_pos, count)
1439  如果retval小于0则转到:fput_out
1442  如果非maxmax等于两数取小(s_maxbytes, s_maxbytes)
1445  如果此条件成立可能性小(为编译器优化)(pos + count > max)则
1446  retval等于负EOVERFLOW
1447  如果pos大于等于max则转到:fput_out
1449  count等于maxpos
1452  fl等于0
1463  file_start_write(file)
1464  retval等于do_splice_direct - splices data directly between two files*@in: file to splice from*@ppos: input file offset*@out: file to splice to*@opos: output file offset*@len: number of bytes to splice*@flags: splice modifier flags* Description:
1465  file_end_write(file)
1467  如果retval大于0则
1468  add_rchar(当前进程, retval)
1469  add_wchar(当前进程, retval)
1470  snotify_access - file was read
1471  snotify_modify - file was modified
1472  f_pos等于out_pos
1473  如果pposppos等于pos
1475  否则f_pos等于pos
1479  inc_syscr(当前进程)
1480  inc_syscw(当前进程)
1481  如果pos大于maxretval等于负EOVERFLOW
1484  fput_out :
1485  fdput(out)
1486  fput_in :
1487  fdput(in)
1488  out :
1489  返回:retval
调用者
名称描述
SYSCALL_DEFINE4
SYSCALL_DEFINE4
COMPAT_SYSCALL_DEFINE4
COMPAT_SYSCALL_DEFINE4