函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\read_write.c Create Date:2022-07-29 10:31:33
Last Modify:2020-03-18 10:18:51 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

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

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

返回类型:int

参数:

类型参数名称
struct file *file_in
loff_tpos_in
struct file *file_out
loff_tpos_out
loff_t *len
unsigned intremap_flags
1948  inode_in等于file_inode(file_in)
1949  inode_out等于file_inode(file_out)
1950  same_inode等于inode_in恒等于inode_out
1954  如果IS_IMMUTABLE(inode_out)则返回:负EPERM
1957  如果IS_SWAPFILE(inode_in)或IS_SWAPFILE(inode_out)则返回:负ETXTBSY
1961  如果S_ISDIR(i_mode)或S_ISDIR(i_mode)则返回:负EISDIR
1963  如果非S_ISREG(i_mode)或非S_ISREG(i_mode)则返回:负EINVAL
1967  如果len恒等于0则
1968  isize等于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
1970  如果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恒等于isize则返回:0
1972  如果pos_in大于isize则返回:负EINVAL
1974  len等于isizepos_in
1975  如果len恒等于0则返回:0
1980  ret等于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.
1982  如果ret则返回:ret
1986  inode_dio_wait(inode_in)
1987  如果非same_inodeinode_dio_wait(inode_out)
1990  ret等于lemap_write_and_wait_range - write out & wait on a file range*@mapping: the address_space for the pages*@lstart: offset in bytes where the range starts*@lend: offset in bytes where the range ends (inclusive)
1992  如果ret则返回:ret
1995  ret等于lemap_write_and_wait_range - write out & wait on a file range*@mapping: the address_space for the pages*@lstart: offset in bytes where the range starts*@lend: offset in bytes where the range ends (inclusive)
1997  如果ret则返回:ret
2003  如果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.
2004  bool is_same = false
2006  ret等于Compare extents of two files to see if they are the same.* Caller must have locked both inodes to prevent write races.
2008  如果ret则返回:ret
2010  如果非is_same则返回:负EBADE
2014  ret等于Ensure that we don't remap a partial EOF block in the middle of something* else. Assume that the offsets have already been checked for block* alignment.* For clone we only link a partial EOF block above or at the destination file's* EOF
2016  如果ret则返回:ret
2020  如果非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.的值则ret等于file_modified(file_out)
2023  返回:ret