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