函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\filemap.c Create Date:2022-07-27 15:26:07
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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.

函数原型:int generic_copy_file_checks(struct file *file_in, loff_t pos_in, struct file *file_out, loff_t pos_out, size_t *req_count, unsigned int flags)

返回类型:int

参数:

类型参数名称
struct file *file_in
loff_tpos_in
struct file *file_out
loff_tpos_out
size_t *req_count
unsigned intflags
3080  inode_in等于file_inode(file_in)
3081  inode_out等于file_inode(file_out)
3082  count等于req_count
3086  ret等于Performs common checks before doing a file copy/clone* from @file_in to @file_out.
3087  如果ret则返回:ret
3091  如果IS_IMMUTABLE(inode_out)则返回:负EPERM
3094  如果IS_SWAPFILE(inode_in)或IS_SWAPFILE(inode_out)则返回:负ETXTBSY
3098  如果pos_incount小于pos_inpos_outcount小于pos_out则返回:负EOVERFLOW
3102  size_in等于NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they
3103  如果pos_in大于等于size_incount等于0
3105  否则count等于两数取小(count, size_in - (uint64_t)pos_in)
3108  ret等于Don't operate on ranges the page cache doesn't support, and don't exceed the* LFS limits. If pos is under the limit it becomes a short access. If it* exceeds the limit we return -EFBIG.
3109  如果ret则返回:ret
3113  如果inode_in恒等于inode_outpos_outcount大于pos_inpos_out小于pos_incount则返回:负EINVAL
3118  req_count等于count
3119  返回:0
调用者
名称描述
vfs_copy_file_rangepy_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.