Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:static int generic_remap_check_len(struct inode *inode_in, struct inode *inode_out, loff_t pos_out, loff_t *len, unsigned int remap_flags)

Type:int

Parameter:

TypeParameterName
struct inode *inode_in
struct inode *inode_out
loff_tpos_out
loff_t *len
unsigned intremap_flags
1792  blkmask = i_blocksize(inode_in) - 1
1793  new_len = len
1795  If (len & blkmask) == 0 Then Return 0
1798  If pos_out + len < 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 Then new_len &= ~blkmask
1801  If new_len == len Then Return 0
1804  If remap_flags & REMAP_FILE_CAN_SHORTEN Then
1805  len = new_len
1806  Return 0
1809  Return If 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. Then -EBADE Else -EINVAL
Caller
NameDescribe
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.