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 oldsize,
10 loff_t newsize);
11
13 inode
14 inode
15
16 oldsize
17 old file size
18
19 newsize
20 new file size
21
23 inodeĀ“s new i_size must already be written before truncate_pagecache is
24 called.
25
26 This function should typically be called before the filesystem releases
27 resources associated with the freed range (eg. deallocates blocks).
28 This way, pagecache will always stay logically coherent with on-disk
29 format, and the filesystem would not have to deal with situations such
30 as writepage being called for a page that has already had its
31 underlying blocks deallocated.
32
34Kernel Hackers Manual 2.6. June 2019 TRUNCATE_PAGECACHE(9)