VOP_BMAP(9)
okay bestie, welcome to VOP_BMAP(9) from the Kernel Developer's Manual β literally the page about logical-to-physical block number conversion, and it's lowkey iconic π
β¨
πΈ NAME πΈ
VOP_BMAP β Logical to physical block number conversion
π SYNOPSIS π
first up, the required includes and the signature, exactly as they are, no cap:
#include <sys/param.h>
#include <sys/vnode.h>
int
VOP_BMAP(struct vnode *vp, daddr_t bn, struct bufobj **bop,
daddr_t *bnp, int *runp, int *runb);
π DESCRIPTION π
okay so this vnode call is used to lookup the physical block number of the file system's underlying device where a given logical block of a file is stored. its arguments are giving:
vpβ The vnode of the file. π«Άbnβ Logical block number within the file identified byvp.bopβ Return storage for the buffer object associated with the file system's underlying device.bnpβ Return storage for the physical block number.runpβ Return storage for the number of succeeding logical blocks that may be efficiently read at the same time as the requested block. This will usually be the number of logical blocks whose physical blocks are contiguously allocated. However a file system is free to define"efficient"as it sees fit.runbβ Likerunpbut for preceding rather than succeeding blocks.
Any of the return arguments may be NULL to indicate that the caller does not care about that information. periodt π
π LOCKS π
The vnode will be locked on entry and should remain locked on return. keep that lock energy, bestie π₯
π¦ RETURN VALUES π¦
Zero is returned on success, otherwise an error code is returned. slay β π
π SEE ALSO π
π§ HISTORY π§
A bmap() function first appeared in 4.2BSD. vintage behavior fr fr π
π AUTHORS π
This manual page was written by Alan Somers. ty king π«Άβ¨
kisses, this cutie is from the Debian edition, dated June 19, 2019, and it's the VOP_BMAP(9) manual page β mwah π
π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- π the page's license: BSD-2-Clause
- Copyright (c) 2019 The FreeBSD Foundation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms