Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/vn_deallocate.9
- This file was added.
.\" | |||||
.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD | |||||
.\" | |||||
.\" Copyright (c) 2021 The FreeBSD Foundation | |||||
.\" | |||||
.\" Redistribution and use in source and binary forms, with or without | |||||
.\" modification, are permitted provided that the following conditions | |||||
.\" are met: | |||||
.\" 1. Redistributions of source code must retain the above copyright | |||||
.\" notice, this list of conditions and the following disclaimer. | |||||
.\" 2. Redistributions in binary form must reproduce the above copyright | |||||
.\" notice, this list of conditions and the following disclaimer in the | |||||
.\" documentation and/or other materials provided with the distribution. | |||||
.\" | |||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | |||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | |||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||||
.\" SUCH DAMAGE. | |||||
.\" | |||||
.Dd July 9, 2001 | |||||
.Dt VN_DEALLOCATE 9 | |||||
.Os | |||||
.Sh NAME | |||||
.Nm vn_deallocate | |||||
.Nd zero and/or deallocate storage from a file | |||||
.Sh SYNOPSIS | |||||
.In sys/param.h | |||||
.In sys/vnode.h | |||||
.Ft int | |||||
.Fn vn_deallocate "struct vnode *vp" "off_t offset" "off_t len" "int flags" "int ioflg" "struct ucred *active_cred" "struct ucred *file_cred" | |||||
.Sh DESCRIPTION | |||||
The | |||||
.Fn vn_deallocate | |||||
function zeros and/or deallocate backing storage space from a file. | |||||
This function only works on vnodes with | |||||
bcr: Not sure about this one: s/deallocate/deallocates/ | |||||
.Dv VREG | |||||
type. | |||||
.Pp | |||||
The arguments are: | |||||
.Bl -tag -width active_cred | |||||
.It Fa vp | |||||
The vnode of the file. | |||||
.It Fa offset | |||||
The starting offset of the operation range | |||||
.It Fa len | |||||
The length of the operation range. This argument must be greater than 0. | |||||
.It Fa flags | |||||
Not Done Inline ActionsNeeds a line break here after the sentence stop. bcr: Needs a line break here after the sentence stop. | |||||
The control flags argument of the operation. | |||||
.It Fa ioflg | |||||
The control flags argument of vnode locking. | |||||
.It Fa active_cred | |||||
The user credentials of the calling thread. | |||||
.It Fa file_cred | |||||
The credentials installed on the file description pointing to the vnode or NOCRED. | |||||
.El | |||||
.Pp | |||||
The | |||||
.Fn flags | |||||
argument may be one or more of the following flags: | |||||
.Bl -tag -width SPACECTL_F_CANEXTEND | |||||
.It Dv SPACECTL_F_CANEXTEND | |||||
The operation can extend the file size if | |||||
.Fa offset | |||||
+ | |||||
.Fa len | |||||
is greater than the current file size. | |||||
Not Done Inline ActionsWhat is this? kib: What is this? | |||||
Done Inline ActionsLeftover from implementing posix_fallocate. Will clean this up. khng: Leftover from implementing posix_fallocate. Will clean this up. | |||||
.El | |||||
.Pp | |||||
The | |||||
.Fn ioflg | |||||
argument may be one or more of the following flags: | |||||
.Bl -tag -width IO_RANGELOCKED | |||||
.It Dv IO_NODELOCKED | |||||
The caller has granted vnode lock. | |||||
.It Dv IO_RANGELOCKED | |||||
The caller has granted vnode rangelock. | |||||
Not Done Inline ActionsWhat it means 'granted'? kib: What it means 'granted'? | |||||
Done Inline Actions'acquired' khng: 'acquired' | |||||
.El | |||||
.Sh RETURN VALUES | |||||
Upon successful completion, the value 0 is returned; otherwise the | |||||
appropriate error is returned. | |||||
.Sh SEE ALSO | |||||
.Xr vnode 9 , | |||||
.Xr VOP_DEALLOCATE 9 | |||||
.Sh AUTHORS | |||||
.Nm | |||||
and this manual page were developed by | |||||
.An Ka Ho Ng Aq Mt khng@FreeBSDFoundation.org | |||||
under sponsorship from the FreeBSD Foundation. |
Not sure about this one: s/deallocate/deallocates/