---
name: "truncate_pagecache"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/truncate_pagecache"
---

# truncate\_pagecache(9)

unmap and remove pagecache that has been truncated

## NAME

truncate\_pagecache - unmap and remove pagecache that has been truncated

## SYNOPSIS

**void truncate\_pagecache(struct inode \*** *inode***, loff\_t** *newsize***);**

## ARGUMENTS

*inode*

inode

*newsize*

new file size

## DESCRIPTION

inode's new i\_size must already be written before truncate\_pagecache is called.

This function should typically be called before the filesystem releases resources associated with the freed range (eg. deallocates blocks). This way, pagecache will always stay logically coherent with on-disk format, and the filesystem would not have to deal with situations such as writepage being called for a page that has already had its underlying blocks deallocated.

## COPYRIGHT
