Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\filemap.c Create Date:2022-07-28 14:03:10
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

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

Proto: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)

Type:int

Parameter:

TypeParameterName
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  If ret Then Return ret
3091  If IS_IMMUTABLE(inode_out) Then Return -EPERM
3094  If IS_SWAPFILE(inode_in) || IS_SWAPFILE(inode_out) Then Return -ETXTBSY
3098  If pos_in + count < pos_in || pos_out + count < pos_out Then Return -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  If pos_in >= size_in Then count = 0
3105  Else count = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(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  If ret Then Return ret
3113  If inode_in == inode_out && pos_out + count > pos_in && pos_out < pos_in + count Then Return -EINVAL
3118  req_count = count
3119  Return 0