bp_mapin(D3DK) —
.IX \f4bp_mapin\fP(D3DK)
NAME
bp_mapin − allocate virtual address space for buffer page list
SYNOPSIS
#include <sys/types.h>
#include <sys/buf.h>
void bp_mapin(struct buf ∗bp);
ARGUMENTS
bpPointer to the buffer header structure.
DESCRIPTION
The bp_mapin function is used to map virtual address space to a page list maintained by the buffer header [see buf(D4DK)] during a paged-I/O request. A paged-I/O request is identified by the B_PAGEIO flag being set in the b_flags field of the buffer header passed to a driver’s strategy(D2DK) routine. Before calling bp_mapin, the offset of the location in the first page where the I/O is to begin is stored in the b_un.b_addr field of the buf structure referenced by bp (for strategy routines, this is done for the driver by the system.)
bp_mapin allocates system virtual address space, maps that space to the page list, and returns the new virtual address in the b_un.b_addr field of the buf structure. This address is the virtual address of the start of the page mappings, plus the offset requested by the caller. After the I/O completes, the virtual address space can be deallocated using the bp_mapout(D3DK) function.
RETURN VALUE
None.
LEVEL
Base only.
NOTES
This routine may sleep if virtual space is not immediately available.
Driver-defined basic locks and read/write locks may not be held across calls to this function.
Driver-defined sleep locks may be held across calls to this function.
SEE ALSO
devflag(D1DK), strategy(D2DK), bp_mapout(D3DK), buf(D4DK)
DDI/DKI