函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Performs necessary checks before doing a clone.* Can adjust amount of bytes to clone via @req_count argument.* Returns appropriate error code that caller should return or* zero in case the clone should be allowed.

函数原型:int generic_remap_checks(struct file *file_in, loff_t pos_in, struct file *file_out, loff_t pos_out, loff_t *req_count, unsigned int remap_flags)

返回类型:int

参数:

类型参数名称
struct file *file_in
loff_tpos_in
struct file *file_out
loff_tpos_out
loff_t *req_count
unsigned intremap_flags
2979  inode_in等于host
2980  inode_out等于host
2981  count等于req_count
2984  bs等于s_blocksize
2988  如果非IS_ALIGNED(pos_in, bs)或非IS_ALIGNED(pos_out, bs)则返回:负EINVAL
2992  如果pos_incount小于pos_inpos_outcount小于pos_out则返回:负EINVAL
2995  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
2996  size_out等于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
2999  如果remap_flags按位与These flags control the behavior of the remap_file_range function pointer.* If it is called with len == 0 that means "remap to end of source file".* See Documentation/filesystems/vfs.rst for more details about this call.pos_in大于等于size_inpos_incount大于size_inpos_out大于等于size_outpos_outcount大于size_out的值则返回:负EINVAL
3005  如果pos_in大于等于size_in则返回:负EINVAL
3007  count等于两数取小(count, size_in - (uint64_t)pos_in)
3009  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.
3010  如果ret则返回:ret
3020  如果pos_incount恒等于size_in
3021  bcount等于@a is a power of 2 value (size_in, bs)减pos_in
3022  否则
3023  如果非IS_ALIGNED(count, bs)则count等于ALIGN_DOWN(count, bs)
3025  bcount等于count
3029  如果inode_in恒等于inode_outpos_outbcount大于pos_inpos_out小于pos_inbcount则返回:负EINVAL
3038  如果req_count不等于count且非remap_flags按位与REMAP_FILE_CAN_SHORTEN的值则返回:负EINVAL
3041  req_count等于count
3042  返回:0
调用者
名称描述
generic_remap_file_range_prepCheck that the two inodes are eligible for cloning, the ranges make* sense, and then flush all dirty data. Caller must ensure that the* inodes have been locked against any other modifications.