1TRUNCATE_PAGECACHE(9) Memory Management in Linux TRUNCATE_PAGECACHE(9)
2
3
4
6 truncate_pagecache - unmap and remove pagecache that has been truncated
7
9 void truncate_pagecache(struct inode * inode, loff_t newsize);
10
12 inode
13 inode
14
15 newsize
16 new file size
17
19 inode's new i_size must already be written before truncate_pagecache is
20 called.
21
22 This function should typically be called before the filesystem releases
23 resources associated with the freed range (eg. deallocates blocks).
24 This way, pagecache will always stay logically coherent with on-disk
25 format, and the filesystem would not have to deal with situations such
26 as writepage being called for a page that has already had its
27 underlying blocks deallocated.
28
30Kernel Hackers Manual 3.10 June 2019 TRUNCATE_PAGECACHE(9)