---
name: "vnode_pager_setsize"
section: "9"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/vnode_pager_setsize"
---

# vnode\_pager\_setsize(9)

notify the VM system about updates in the file size

## NAME

**vnode\_pager\_setsize** – notify the VM system about updates in the file size

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<vm/vm.h\>**

**#include \<vm/vm\_extern.h\>**

*void*\

**vnode\_pager\_setsize**(*struct vnode \*vp*, *vm\_ooffset\_t nsize*);

## DESCRIPTION

**vnode\_pager\_setsize** lets the VM system know about a change in size for a file, and updates the object size and vnode pager size of the vm object in *vp* with *nsize*. Page faults on the object mapping with offset beyond the new object size results in *SIGBUS*.

Pages between the old EOF and the new EOF are removed from the object queue if the file size shrinks. In case the new EOF specified by the *nsize* argument is not aligned to page boundary, partial-page area starting beyond the EOF is zeroed and marked invalid. if the page exists resident.

In case the vnode *vp* does not have a VM object allocated, the effect of calling this function is no-op.

This function must be used within file system code to implement truncation if the file system allocates vm objects for vnodes.

## LOCKS

The vnode should be exclusively locked on entry and will still be locked on exit.

## SEE ALSO

[vnode(9)](/vnode/9.md)

## HISTORY

The **vnode\_pager\_setsize** manual page first appeared in FreeBSD 14.

## AUTHORS

This manual page was written by Ka Ho Ng ⟨*khng@FreeBSD.org*⟩.
