1.\"- 2.\" SPDX-License-Identifier: BSD-2-Clause 3.\" 4.\" Copyright (c) 2019 The FreeBSD Foundation 5.\" 6.\" This documentation was written by BFF Storage Systems, LLC under 7.\" sponsorship from the FreeBSD Foundation. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 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. 17.\" 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 28.\" SUCH DAMAGE. 29.\" 30.Dd June 19, 2019 31.Dt VOP_BMAP 9 32.Os 33.Sh NAME 34.Nm VOP_BMAP 35.Nd Logical to physical block number conversion 36.Sh SYNOPSIS 37.In sys/param.h 38.In sys/vnode.h 39.Ft int 40.Fn VOP_BMAP "struct vnode *vp" "daddr_t bn" "struct bufobj **bop" "daddr_t *bnp" "int *runp" "int *runb" 41.Sh DESCRIPTION 42This vnode call is used to lookup the physical block number of the file system's 43underlying device where a given logical block of a file is stored. 44Its arguments are: 45.Bl -tag -width type 46.It Fa vp 47The vnode of the file. 48.It Fa bn 49Logical block number within the file identified by 50.Fa vp . 51.It Fa bop 52Return storage for the buffer object associated with the file system's 53underlying device. 54.It Fa bnp 55Return storage for the physical block number. 56.It Fa runp 57Return storage for the number of succeeding logical blocks that may be 58efficiently read at the same time as the requested block. 59This will usually be the number of logical blocks whose physical blocks are 60contiguously allocated. 61However a file system is free to define "efficient" as it sees fit. 62.It Fa runb 63Like 64.Fa runp 65but for preceding rather than succeeding blocks. 66.El 67.Pp 68Any of the return arguments may be 69.Dv NULL 70to indicate that the caller does not care about that information. 71.Sh LOCKS 72The vnode will be locked on entry and should remain locked on return. 73.Sh RETURN VALUES 74Zero is returned on success, otherwise an error code is returned. 75.Sh SEE ALSO 76.Xr vnode 9 77.Sh HISTORY 78A 79.Fn bmap 80function first appeared in 81.Bx 4.2 . 82.Sh AUTHORS 83This manual page was written by 84.An Alan Somers . 85