2 .\" SPDX-License-Identifier: BSD-2-Clause
4 .\" Copyright (c) 2021 The FreeBSD Foundation
6 .\" This manual page was written by Ka Ho Ng under sponsorship from
7 .\" 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
35 .Nd zero and/or deallocate storage from a file
41 .Fa "struct vnode *vp"
46 .Fa "struct ucred *active_cred"
47 .Fa "struct ucred *file_cred"
52 function zeros and/or deallocates backing storage space from a file.
53 This function only works on vnodes with
58 .Bl -tag -width active_cred
60 The vnode of the file.
62 The starting offset of the operation range.
64 The length of the operation range.
65 This must be greater than 0.
67 The control flags of the operation.
68 This should be set to 0 for now.
70 Directives and hints to be given to the file system.
72 The user credentials of the calling thread.
74 The credentials installed on the file description pointing to the vnode or NOCRED.
79 argument gives directives and hints to the file system.
80 It may include one or more of the following flags:
81 .Bl -tag -width IO_RANGELOCKED
83 The vnode was locked before the call.
85 Rangelock was owned around the call.
87 Skip MAC checking in the call.
91 Attempt to bypass buffer cache.
97 are updated to reflect the unprocessed operation range of the call.
98 For a successful completion,
100 is updated to be the value 0, and
102 is incremented by the number of bytes zeroed before the end-of-file.
104 Upon successful completion, the value 0 is returned; otherwise the
105 appropriate error is returned.
111 and this manual page was written by
112 .An Ka Ho Ng Aq Mt khng@FreeBSD.org
113 under sponsorship from the FreeBSD Foundation.