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