Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\read_write.c Create Date:2022-07-28 20:01:26
Last Modify:2020-03-18 10:18:51 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:do_sendfile

Proto:static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, size_t count, loff_t max)

Type:ssize_t

Parameter:

TypeParameterName
intout_fd
intin_fd
loff_t *ppos
size_tcount
loff_tmax
1406  retval = -EBADF
1407  in = fdget(in_fd)
1408  If Not file Then Go to out
1410  If Not (f_mode & le is open for reading ) Then Go to fput_in
1412  retval = -ESPIPE
1413  If Not ppos Then
1414  pos = f_pos
1415  Else
1416  pos = ppos
1417  If Not (f_mode & le can be accessed using pread ) Then Go to fput_in
1420  retval = rw_verify_area(generic data direction definitions , file, & pos, count)
1421  If retval < 0 Then Go to fput_in
1423  If count > MAX_RW_COUNT Then count = MAX_RW_COUNT
1429  retval = -EBADF
1430  out = fdget(out_fd)
1431  If Not file Then Go to fput_in
1433  If Not (f_mode & le is open for writing ) Then Go to 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  If retval < 0 Then Go to fput_out
1442  If Not max Then max = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(s_maxbytes, s_maxbytes)
1445  If Value for the false possibility is greater at compile time(pos + count > max) Then
1446  retval = -EOVERFLOW
1447  If pos >= max Then Go to fput_out
1449  count = max - pos
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  If retval > 0 Then
1468  add_rchar(current process, retval)
1469  add_wchar(current process, retval)
1470  snotify_access - file was read
1471  snotify_modify - file was modified
1472  f_pos = out_pos
1473  If ppos Then ppos = pos
1475  Else f_pos = pos
1479  inc_syscr(current process)
1480  inc_syscw(current process)
1481  If pos > max Then retval = -EOVERFLOW
1484  fput_out :
1485  fdput(out)
1486  fput_in :
1487  fdput(in)
1488  out :
1489  Return retval
Caller
NameDescribe
SYSCALL_DEFINE4
SYSCALL_DEFINE4
COMPAT_SYSCALL_DEFINE4
COMPAT_SYSCALL_DEFINE4