Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:SYSCALL_DEFINE6

Proto:SYSCALL_DEFINE6(copy_file_range, int, fd_in, loff_t __user *, off_in, int, fd_out, loff_t __user *, off_out, size_t, len, unsigned int, flags)

Type:

Parameter:Nothing

1698  ret = -EBADF
1700  f_in = fdget(fd_in)
1701  If Not file Then Go to out2
1704  f_out = fdget(fd_out)
1705  If Not file Then Go to out1
1708  ret = -EFAULT
1709  If off_in Then
1710  If copy_from_user( & pos_in, off_in, sizeof(loff_t)) Then Go to out
1712  Else
1713  pos_in = f_pos
1716  If off_out Then
1717  If copy_from_user( & pos_out, off_out, sizeof(loff_t)) Then Go to out
1719  Else
1720  pos_out = f_pos
1723  ret = py_file_range() differs from regular file read and write in that it* specifically allows return partial success. When it does so is up to* the copy_file_range method.
1725  If ret > 0 Then
1726  pos_in += ret
1727  pos_out += ret
1729  If off_in Then
1730  If copy_to_user(off_in, & pos_in, sizeof(loff_t)) Then ret = -EFAULT
1732  Else
1733  f_pos = pos_in
1736  If off_out Then
1737  If copy_to_user(off_out, & pos_out, sizeof(loff_t)) Then ret = -EFAULT
1739  Else
1740  f_pos = pos_out
1744  out :
1745  fdput(f_out)
1746  out1 :
1747  fdput(f_in)
1748  out2 :
1749  Return ret