2 .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 .\" Copyright (c) 2021 The FreeBSD Foundation
6 .\" Portions of this software were developed by Ka Ho Ng
7 .\" under sponsorship from the FreeBSD Foundation.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .Dt VNODE_PAGER_SETSIZE 9
34 .Nm vnode_pager_setsize
35 .Nd "notify the VM system about updates in the file size"
41 .Fn vnode_pager_setsize "struct vnode *vp" "vm_ooffset_t nsize"
44 lets the VM system know about a change in size for a file,
45 and updates the object size and vnode pager size of the vm object in
49 Page faults on the object mapping with offset beyond the new object
53 Pages between the old EOF and the new EOF are removed from the object queue
54 if the file size shrinks.
55 In case the new EOF specified by the
57 argument is not aligned to page boundary,
58 partial-page area starting beyond the EOF is zeroed and marked invalid.
59 if the page exists resident.
63 does not have a VM object allocated, the effect of calling this function is no-op.
65 This function must be used within file system code to implement truncation
66 if the file system allocates vm objects for vnodes.
68 The vnode should be exclusively locked on entry and will still be locked on exit.
74 manual page first appeared in
78 manual page was written by
79 .An Ka Ho Ng Aq Mt khng@FreeBSD.org .