函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:do_sys_ftruncate

函数原型:long do_sys_ftruncate(unsigned int fd, loff_t length, int small)

返回类型:long

参数:

类型参数名称
unsigned intfd
loff_tlength
intsmall
162  error等于负EINVAL
163  如果length小于0则转到:out
165  error等于负EBADF
166  f等于fdget(fd)
167  如果非file则转到:out
171  如果f_flags按位与O_LARGEFILEsmall等于0
174  dentry等于dentry
175  inode等于 Where the name belongs to - NULL is * negative
176  error等于负EINVAL
177  如果非S_ISREG(i_mode)或非f_mode按位与le is open for writing 的值则转到:out_putf
180  error等于负EINVAL
182  如果smalllength大于MAX_NON_LFS则转到:out_putf
185  error等于负EPERM
187  如果IS_APPEND(file_inode(file))则转到:out_putf
190  sb_start_write - get write access to a superblock*@sb: the super we write to* When a process wants to write data or metadata to a file system (i.e. dirty* a page or an inode), it should embed the operation in a sb_start_write() -
191  error等于locks_verify_truncate(inode, file, length)
192  如果非errorerror等于security_path_truncate( & f_path)
194  如果非errorerror等于do_truncate(dentry, length, ATTR_MTIME | ATTR_CTIME, file)
196  超级块解除写访问
197  out_putf :
198  fdput(f)
199  out :
200  返回:error
调用者
名称描述
SYSCALL_DEFINE2
COMPAT_SYSCALL_DEFINE2
SYSCALL_DEFINE2
ksys_ftruncate