函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:vfs_truncate

函数原型:long vfs_truncate(const struct path *path, loff_t length)

返回类型:long

参数:

类型参数名称
const struct path *path
loff_tlength
74  inode等于d_inode
77  如果S_ISDIR(i_mode)则返回:负EISDIR
79  如果非S_ISREG(i_mode)则返回:负EINVAL
82  error等于mnt_want_write(mnt)
83  如果error则转到:out
86  error等于inode_permission(inode, MAY_WRITE)
87  如果error则转到:mnt_drop_write_and_out
90  error等于负EPERM
91  如果IS_APPEND(inode)则转到:mnt_drop_write_and_out
94  error等于get_write_access() gets write permission for a file.* put_write_access() releases this write permission.* This is used for regular files.* We cannot support write (and maybe mmap read-write shared) accesses and* MAP_DENYWRITE mmappings simultaneously
95  如果error则转到:mnt_drop_write_and_out
102  error等于break_lease(inode, O_WRONLY)
103  如果error则转到:put_write_and_out
106  error等于locks_verify_truncate(inode, NULL, length)
107  如果非errorerror等于security_path_truncate(path)
109  如果非errorerror等于do_truncate(dentry, length, 0, NULL)
112  put_write_and_out :
113  put_write_access(inode)
114  mnt_drop_write_and_out :
115  mnt_drop_write(mnt)
116  out :
117  返回:error
调用者
名称描述
do_sys_truncate