Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:do_truncate

Proto:int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs, struct file *filp)

Type:int

Parameter:

TypeParameterName
struct dentry *dentry
loff_tlength
unsigned inttime_attrs
struct file *filp
45  If length < 0 Then Return -EINVAL
48  ia_size = length
49  ia_valid = ATTR_SIZE | time_attrs
50  If filp Then
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  If ret < 0 Then Return ret
59  If ret Then ia_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  Return ret
Caller
NameDescribe
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.