1d01752c7SAlan Somers.\"- 24d846d26SWarner Losh.\" SPDX-License-Identifier: BSD-2-Clause 3d01752c7SAlan Somers.\" 4d01752c7SAlan Somers.\" Copyright (c) 2019 The FreeBSD Foundation 5d01752c7SAlan Somers.\" 6b13625b5SAlan Somers.\" This documentation was written by BFF Storage Systems, LLC under 7b13625b5SAlan Somers.\" sponsorship from the FreeBSD Foundation. 8d01752c7SAlan Somers.\" 9d01752c7SAlan Somers.\" Redistribution and use in source and binary forms, with or without 10d01752c7SAlan Somers.\" modification, are permitted provided that the following conditions 11d01752c7SAlan Somers.\" are met: 12d01752c7SAlan Somers.\" 1. Redistributions of source code must retain the above copyright 13d01752c7SAlan Somers.\" notice, this list of conditions and the following disclaimer. 148bd416a2SAlan Somers.\" 2. Redistributions in binary form must reproduce the above copyright 15d01752c7SAlan Somers.\" notice, this list of conditions and the following disclaimer in the 16d01752c7SAlan Somers.\" documentation and/or other materials provided with the distribution. 17d01752c7SAlan Somers.\" 18d01752c7SAlan Somers.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19d01752c7SAlan Somers.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20d01752c7SAlan Somers.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21d01752c7SAlan Somers.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22d01752c7SAlan Somers.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23d01752c7SAlan Somers.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24d01752c7SAlan Somers.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25d01752c7SAlan Somers.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26d01752c7SAlan Somers.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27d01752c7SAlan Somers.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28d01752c7SAlan Somers.\" SUCH DAMAGE. 29d01752c7SAlan Somers.\" 30d01752c7SAlan Somers.Dd June 19, 2019 31d01752c7SAlan Somers.Dt VOP_BMAP 9 32d01752c7SAlan Somers.Os 33d01752c7SAlan Somers.Sh NAME 34d01752c7SAlan Somers.Nm VOP_BMAP 35d01752c7SAlan Somers.Nd Logical to physical block number conversion 36d01752c7SAlan Somers.Sh SYNOPSIS 37d01752c7SAlan Somers.In sys/param.h 38d01752c7SAlan Somers.In sys/vnode.h 39d01752c7SAlan Somers.Ft int 40d01752c7SAlan Somers.Fn VOP_BMAP "struct vnode *vp" "daddr_t bn" "struct bufobj **bop" "daddr_t *bnp" "int *runp" "int *runb" 41d01752c7SAlan Somers.Sh DESCRIPTION 42d01752c7SAlan SomersThis vnode call is used to lookup the physical block number of the file system's 43d01752c7SAlan Somersunderlying device where a given logical block of a file is stored. 44d01752c7SAlan SomersIts arguments are: 45d01752c7SAlan Somers.Bl -tag -width type 46d01752c7SAlan Somers.It Fa vp 47d01752c7SAlan SomersThe vnode of the file. 48d01752c7SAlan Somers.It Fa bn 49d01752c7SAlan SomersLogical block number within the file identified by 50d01752c7SAlan Somers.Fa vp . 51d01752c7SAlan Somers.It Fa bop 52d01752c7SAlan SomersReturn storage for the buffer object associated with the file system's 53d01752c7SAlan Somersunderlying device. 54d01752c7SAlan Somers.It Fa bnp 55d01752c7SAlan SomersReturn storage for the physical block number. 56d01752c7SAlan Somers.It Fa runp 57d01752c7SAlan SomersReturn storage for the number of succeeding logical blocks that may be 58d01752c7SAlan Somersefficiently read at the same time as the requested block. 59d01752c7SAlan SomersThis will usually be the number of logical blocks whose physical blocks are 60d01752c7SAlan Somerscontiguously allocated. 61*663a704aSMark JohnstonHowever a file system is free to define "efficient" as it sees fit. 62d01752c7SAlan Somers.It Fa runb 63d01752c7SAlan SomersLike 64d01752c7SAlan Somers.Fa runp 65d01752c7SAlan Somersbut for preceding rather than succeeding blocks. 66d01752c7SAlan Somers.El 67d01752c7SAlan Somers.Pp 68d01752c7SAlan SomersAny of the return arguments may be 69d01752c7SAlan Somers.Dv NULL 70d01752c7SAlan Somersto indicate that the caller does not care about that information. 71d01752c7SAlan Somers.Sh LOCKS 72d01752c7SAlan SomersThe vnode will be locked on entry and should remain locked on return. 73d01752c7SAlan Somers.Sh RETURN VALUES 74d01752c7SAlan SomersZero is returned on success, otherwise an error code is returned. 75d01752c7SAlan Somers.Sh SEE ALSO 768a2f9dffSGordon Bergling.Xr vnode 9 77d01752c7SAlan Somers.Sh HISTORY 78d01752c7SAlan SomersA 79d01752c7SAlan Somers.Fn bmap 80d01752c7SAlan Somersfunction first appeared in 81d01752c7SAlan Somers.Bx 4.2 . 82d01752c7SAlan Somers.Sh AUTHORS 83d01752c7SAlan SomersThis manual page was written by 84d01752c7SAlan Somers.An Alan Somers . 85