函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\truncate.c Create Date:2022-07-27 15:38:38
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:runcate_setsize - update inode and pagecache for a new file size*@inode: inode*@newsize: new file size* truncate_setsize updates i_size and performs pagecache truncation (if* necessary) to @newsize. It will be typically be called from the filesystem's

函数原型:void truncate_setsize(struct inode *inode, loff_t newsize)

返回类型:void

参数:

类型参数名称
struct inode *inode
loff_tnewsize
837  oldsize等于i_size
839  NOTE: unlike i_size_read(), i_size_write() does need locking around it* (normally i_mutex), otherwise on 32bit/SMP an update of i_size_seqcount* can be lost, resulting in subsequent i_size_read() calls spinning forever.
840  如果newsize大于oldsizepagecache_isize_extended - update pagecache after extension of i_size*@inode: inode for which i_size was extended*@from: original inode size*@to: new inode size* Handle extension of inode size either caused by extending truncate or by
842  runcate_pagecache - unmap and remove pagecache that has been truncated*@inode: inode*@newsize: new file size* inode's new i_size must already be written before truncate_pagecache* is called.* This function should typically be called before the filesystem
调用者
名称描述
put_aio_ring_file
ramfs_nommu_resize
simple_setattrsimple_setattr - setattr for simple filesystem*@dentry: dentry*@iattr: iattr structure* Returns 0 on success, -error on failure