函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:vfs_fallocate

函数原型:int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)

返回类型:int

参数:

类型参数名称
struct file *file
intmode
loff_toffset
loff_tlen
231  inode等于file_inode(file)
234  如果offset小于0或len小于等于0则返回:负EINVAL
238  如果mode按位与FALLOC_FL_SUPPORTED_MASK的反则返回:负EOPNOTSUPP
242  如果mode按位与de-allocates range 按位或FALLOC_FL_ZERO_RANGE is used to convert a range of file to zeros preferably* without issuing data IO的值的值恒等于de-allocates range 按位或FALLOC_FL_ZERO_RANGE is used to convert a range of file to zeros preferably* without issuing data IO的值则返回:负EOPNOTSUPP
247  如果mode按位与de-allocates range 且非mode按位与default is extend size 的值则返回:负EOPNOTSUPP
252  如果mode按位与FALLOC_FL_COLLAPSE_RANGE is used to remove a range of a file* without leaving a hole in the file. The contents of the file beyond* the range being removed is appended to the start offset of the range* being removed (imode按位与FALLOC_FL_COLLAPSE_RANGE is used to remove a range of a file* without leaving a hole in the file. The contents of the file beyond* the range being removed is appended to the start offset of the range* being removed (i的反则返回:负EINVAL
257  如果mode按位与FALLOC_FL_INSERT_RANGE is use to insert space within the file size without* overwriting any existing data. The contents of the file beyond offset are* shifted towards right by len bytes to create a hole. As such, thismode按位与FALLOC_FL_INSERT_RANGE is use to insert space within the file size without* overwriting any existing data. The contents of the file beyond offset are* shifted towards right by len bytes to create a hole. As such, this的反则返回:负EINVAL
262  如果mode按位与FALLOC_FL_UNSHARE_RANGE is used to unshare shared blocks within the* file size without overwriting any existing datamode按位与FALLOC_FL_UNSHARE_RANGE is used to unshare shared blocks within the* file size without overwriting any existing data按位或default is extend size 的值的反则返回:负EINVAL
266  如果非f_mode按位与le is open for writing 的值则返回:负EBADF
272  如果mode按位与default is extend size 的反且IS_APPEND(inode)则返回:负EPERM
275  如果IS_IMMUTABLE(inode)则返回:负EPERM
281  如果IS_SWAPFILE(inode)则返回:负ETXTBSY
288  ret等于security_file_permission(file, MAY_WRITE)
289  如果ret则返回:ret
292  如果S_ISFIFO(i_mode)则返回:负ESPIPE
295  如果S_ISDIR(i_mode)则返回:负EISDIR
298  如果非S_ISREG(i_mode)且非S_ISBLK(i_mode)则返回:负ENODEV
302  如果offsetlen大于s_maxbytesoffsetlen小于0则返回:负EFBIG
305  如果非fallocate则返回:负EOPNOTSUPP
308  file_start_write(file)
309  ret等于fallocate(file, mode, offset, len)
318  如果ret恒等于0则snotify_modify - file was modified
321  file_end_write(file)
322  返回:ret
调用者
名称描述
ksys_fallocate
ioctl_preallocateThis provides compatibility with legacy XFS pre-allocation ioctls* which predate the fallocate syscall.* Only the l_start, l_len and l_whence fields of the 'struct space_resv'* are used here, rest are ignored.
compat_ioctl_preallocatejust account for different alignment