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