Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/vn_deallocate.9
Show All 21 Lines | |||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" 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 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.Dd Jul 30, 2021 | .Dd August 11, 2021 | ||||
.Dt VN_DEALLOCATE 9 | .Dt VN_DEALLOCATE 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm vn_deallocate | .Nm vn_deallocate | ||||
.Nd zero and/or deallocate storage from a file | .Nd zero and/or deallocate storage from a file | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In sys/param.h | .In sys/param.h | ||||
.In sys/vnode.h | .In sys/vnode.h | ||||
.Ft int | .Ft int | ||||
.Fo vn_deallocate | .Fo vn_deallocate | ||||
.Fa "struct vnode *vp" | .Fa "struct vnode *vp" | ||||
.Fa "off_t *offset" | .Fa "off_t *offset" | ||||
.Fa "off_t *length" | .Fa "off_t *length" | ||||
.Fa "int flags" | .Fa "int flags" | ||||
.Fa "int ioflg" | .Fa "int ioflag" | ||||
.Fa "struct ucred *active_cred" | .Fa "struct ucred *active_cred" | ||||
.Fa "struct ucred *file_cred" | .Fa "struct ucred *file_cred" | ||||
.Fc | .Fc | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Fn vn_deallocate | .Fn vn_deallocate | ||||
function zeros and/or deallocates backing storage space from a file. | function zeros and/or deallocates backing storage space from a file. | ||||
This function only works on vnodes with | This function only works on vnodes with | ||||
.Dv VREG | .Dv VREG | ||||
type. | type. | ||||
.Pp | .Pp | ||||
The arguments are: | The arguments are: | ||||
.Bl -tag -width active_cred | .Bl -tag -width active_cred | ||||
.It Fa vp | .It Fa vp | ||||
The vnode of the file. | The vnode of the file. | ||||
.It Fa offset | .It Fa offset | ||||
The starting offset of the operation range. | The starting offset of the operation range. | ||||
.It Fa length | .It Fa length | ||||
The length of the operation range. | The length of the operation range. | ||||
This must be greater than 0. | This must be greater than 0. | ||||
.It Fa flags | .It Fa flags | ||||
The control flags of the operation. | The control flags of the operation. | ||||
This should be set to 0 for now. | This should be set to 0 for now. | ||||
.It Fa ioflg | .It Fa ioflag | ||||
The control flags of vnode locking. | The control flags of vnode locking. | ||||
.It Fa active_cred | .It Fa active_cred | ||||
The user credentials of the calling thread. | The user credentials of the calling thread. | ||||
.It Fa file_cred | .It Fa file_cred | ||||
The credentials installed on the file description pointing to the vnode or NOCRED. | The credentials installed on the file description pointing to the vnode or NOCRED. | ||||
.El | .El | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn ioflg | .Fn ioflag | ||||
argument may be one or more of the following flags: | argument may be one or more of the following flags: | ||||
.Bl -tag -width IO_RANGELOCKED | .Bl -tag -width IO_RANGELOCKED | ||||
.It Dv IO_NODELOCKED | .It Dv IO_NODELOCKED | ||||
The vnode was locked before the call. | The vnode was locked before the call. | ||||
.It Dv IO_RANGELOCKED | .It Dv IO_RANGELOCKED | ||||
Rangelock was owned around the call. | Rangelock was owned around the call. | ||||
.It Dv IO_NOMACCHECK | .It Dv IO_NOMACCHECK | ||||
Skip MAC checking in the call. | Skip MAC checking in the call. | ||||
Show All 17 Lines |