VOP_BMAP(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

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 by vp.
  • 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 β€” Like runp but 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