xref: /freebsd/share/man/man9/VOP_BMAP.9 (revision b13625b5733ab9c442916b6bb62b80a380a59bc1)
1d01752c7SAlan Somers.\"-
2d01752c7SAlan Somers.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3d01752c7SAlan Somers.\"
4d01752c7SAlan Somers.\" Copyright (c) 2019 The FreeBSD Foundation
5d01752c7SAlan Somers.\"
6*b13625b5SAlan Somers.\" This documentation was written by BFF Storage Systems, LLC under
7*b13625b5SAlan 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.\" $FreeBSD$
31d01752c7SAlan Somers.\"
32d01752c7SAlan Somers.Dd June 19, 2019
33d01752c7SAlan Somers.Dt VOP_BMAP 9
34d01752c7SAlan Somers.Os
35d01752c7SAlan Somers.Sh NAME
36d01752c7SAlan Somers.Nm VOP_BMAP
37d01752c7SAlan Somers.Nd Logical to physical block number conversion
38d01752c7SAlan Somers.Sh SYNOPSIS
39d01752c7SAlan Somers.In sys/param.h
40d01752c7SAlan Somers.In sys/vnode.h
41d01752c7SAlan Somers.Ft int
42d01752c7SAlan Somers.Fn VOP_BMAP "struct vnode *vp" "daddr_t bn" "struct bufobj **bop" "daddr_t *bnp" "int *runp" "int *runb"
43d01752c7SAlan Somers.Sh DESCRIPTION
44d01752c7SAlan SomersThis vnode call is used to lookup the physical block number of the file system's
45d01752c7SAlan Somersunderlying device where a given logical block of a file is stored.
46d01752c7SAlan SomersIts arguments are:
47d01752c7SAlan Somers.Bl -tag -width type
48d01752c7SAlan Somers.It Fa vp
49d01752c7SAlan SomersThe vnode of the file.
50d01752c7SAlan Somers.It Fa bn
51d01752c7SAlan SomersLogical block number within the file identified by
52d01752c7SAlan Somers.Fa vp .
53d01752c7SAlan Somers.It Fa bop
54d01752c7SAlan SomersReturn storage for the buffer object associated with the file system's
55d01752c7SAlan Somersunderlying device.
56d01752c7SAlan Somers.It Fa bnp
57d01752c7SAlan SomersReturn storage for the physical block number.
58d01752c7SAlan Somers.It Fa runp
59d01752c7SAlan SomersReturn storage for the number of succeeding logical blocks that may be
60d01752c7SAlan Somersefficiently read at the same time as the requested block.
61d01752c7SAlan SomersThis will usually be the number of logical blocks whose physical blocks are
62d01752c7SAlan Somerscontiguously allocated.
63d01752c7SAlan SomersHowever a file system is free to define "efficient" as it see fit.
64d01752c7SAlan Somers.It Fa runb
65d01752c7SAlan SomersLike
66d01752c7SAlan Somers.Fa runp
67d01752c7SAlan Somersbut for preceding rather than succeeding blocks.
68d01752c7SAlan Somers.El
69d01752c7SAlan Somers.Pp
70d01752c7SAlan SomersAny of the return arguments may be
71d01752c7SAlan Somers.Dv NULL
72d01752c7SAlan Somersto indicate that the caller does not care about that information.
73d01752c7SAlan Somers.Sh LOCKS
74d01752c7SAlan SomersThe vnode will be locked on entry and should remain locked on return.
75d01752c7SAlan Somers.Sh RETURN VALUES
76d01752c7SAlan SomersZero is returned on success, otherwise an error code is returned.
77d01752c7SAlan Somers.Sh SEE ALSO
78d01752c7SAlan Somers.Xr vnode 9 ,
79d01752c7SAlan Somers.Sh HISTORY
80d01752c7SAlan SomersA
81d01752c7SAlan Somers.Fn bmap
82d01752c7SAlan Somersfunction first appeared in
83d01752c7SAlan Somers.Bx 4.2 .
84d01752c7SAlan Somers.Sh AUTHORS
85d01752c7SAlan SomersThis manual page was written by
86d01752c7SAlan Somers.An Alan Somers .
87