Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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.

Proto:ssize_t vfs_copy_file_range(struct file *file_in, loff_t pos_in, struct file *file_out, loff_t pos_out, size_t len, unsigned int flags)

Type:ssize_t

Parameter:

TypeParameterName
struct file *file_in
loff_tpos_in
struct file *file_out
loff_tpos_out
size_tlen
unsigned intflags
1631  If flags != 0 Then Return -EINVAL
1634  ret = Performs necessary checks before doing a file copy* Can adjust amount of bytes to copy via @req_count argument.* Returns appropriate error code that caller should return or* zero in case the copy should be allowed.
1636  If Value for the false possibility is greater at compile time(ret) Then Return ret
1639  ret = rw_verify_area(generic data direction definitions , file_in, & pos_in, len)
1640  If Value for the false possibility is greater at compile time(ret) Then Return ret
1643  ret = rw_verify_area(WRITE, file_out, & pos_out, len)
1644  If Value for the false possibility is greater at compile time(ret) Then Return ret
1647  If len == 0 Then Return 0
1650  file_start_write(file_out)
1656  If remap_file_range && i_sb == i_sb Then
1660  cloned = remap_file_range(file_in, pos_in, file_out, pos_out, min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(loff_t, MAX_RW_COUNT, len), REMAP_FILE_CAN_SHORTEN)
1664  If cloned > 0 Then
1665  ret = cloned
1666  Go to done
1670  ret = do_copy_file_range(file_in, pos_in, file_out, pos_out, len, flags)
1672  WARN_ON_ONCE(ret == - EOPNOTSUPP)
1673  done :
1674  If ret > 0 Then
1675  snotify_access - file was read
1676  add_rchar(current process, ret)
1677  snotify_modify - file was modified
1678  add_wchar(current process, ret)
1681  inc_syscr(current process)
1682  inc_syscw(current process)
1684  file_end_write(file_out)
1686  Return ret
Caller
NameDescribe
SYSCALL_DEFINE6