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 | |||||
.\" | |||||
.\" This manual page was written by Ka Ho Ng under sponsorship from | |||||
.\" 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 Jul 30, 2021 | |||||
.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 | |||||
.Fo vn_deallocate | |||||
.Fa "struct vnode *vp" | |||||
.Fa "off_t *offset" | |||||
bcr: Not sure about this one: s/deallocate/deallocates/ | |||||
.Fa "off_t *length" | |||||
.Fa "int flags" | |||||
.Fa "int ioflg" | |||||
.Fa "struct ucred *active_cred" | |||||
.Fa "struct ucred *file_cred" | |||||
.Fc | |||||
.Sh DESCRIPTION | |||||
The | |||||
.Fn vn_deallocate | |||||
function zeros and/or deallocates backing storage space from a file. | |||||
This function only works on vnodes with | |||||
.Dv VREG | |||||
Not Done Inline ActionsNeeds a line break here after the sentence stop. bcr: Needs a line break here after the sentence stop. | |||||
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 length | |||||
The length of the operation range. | |||||
This must be greater than 0. | |||||
.It Fa flags | |||||
The control flags of the operation. | |||||
This should be set to 0 for now. | |||||
.It Fa ioflg | |||||
The control flags of vnode locking. | |||||
.It Fa active_cred | |||||
The user credentials of the calling thread. | |||||
.It Fa file_cred | |||||
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. | |||||
The credentials installed on the file description pointing to the vnode or NOCRED. | |||||
.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 vnode was locked before the call. | |||||
.It Dv IO_RANGELOCKED | |||||
Not Done Inline ActionsWhat it means 'granted'? kib: What it means 'granted'? | |||||
Done Inline Actions'acquired' khng: 'acquired' | |||||
Rangelock was owned around the call. | |||||
.It Dv IO_NOMACCHECK | |||||
Skip MAC checking in the call. | |||||
.El | |||||
.Pp | |||||
.Fa *offset | |||||
and | |||||
.Fa *length | |||||
are updated to reflect the unprocessed operation range of the call. | |||||
.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 was written by | |||||
.An Ka Ho Ng Aq Mt khng@FreeBSD.org | |||||
under sponsorship from the FreeBSD Foundation. |
Not sure about this one: s/deallocate/deallocates/