函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:do_truncate

函数原型:int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs, struct file *filp)

返回类型:int

参数:

类型参数名称
struct dentry *dentry
loff_tlength
unsigned inttime_attrs
struct file *filp
45  如果length小于0则返回:负EINVAL
48  ia_size等于length
49  ia_valid等于ATTR_SIZE按位或time_attrs
50  如果filp
51  Not an attribute, but an auxiliary info for filesystems wanting to* implement an ftruncate() like method. NOTE: filesystem should* check for (ia_valid & ATTR_FILE), and not for (ia_file != NULL).等于filp
52  ia_valid或等于ATTR_FILE
56  ret等于dentry_needs_remove_privs(dentry)
57  如果ret小于0则返回:ret
59  如果retia_valid或等于ret按位或Not a change, but a change it
62  inode_lock( Where the name belongs to - NULL is * negative )
64  ret等于notify_change(dentry, & newattrs, NULL)
65  inode_unlock( Where the name belongs to - NULL is * negative )
66  返回:ret
调用者
名称描述
vfs_truncate
do_sys_ftruncate
handle_truncate
do_coredump
dump_truncateEnsures that file size is big enough to contain the current file* postion. This prevents gdb from complaining about a truncated file* if the last "write" to the file was dump_skip.