DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5

buf_breakup(D3)


buf_breakup -- unified I/O breakup routine

Synopsis

   #include <sys/types.h>
   #include <sys/buf.h>
   #include <sys/ddi.h>
   

void buf_breakup(void (*strat)(buf_t *), buf_t *bp, const bcb_t *bcbp)

Description

buf_breakup is a generic buffer breakup routine that modifies the original buffer header and/or breaks the job into multiple pieces, calling the strategy routine one or more times (possibly with newly created buffer headers) such that each call to the strategy routine satisfies a set of constraints. These constraints are specified by the buffer control block pointed to by bcbp and described in bcb(D4).

buf_breakup is capable of handling all types of buffers that might be passed to a driver. It supersedes other, more specific, breakup routines such as dma_pageio(D3) and rdma_filter(D3).

Arguments


strat
Address of subordinate strategy routine.

bp
Pointer to buffer header of buffer to be broken up.

bcbp
Pointer to a bcb(D4) structure describing breakup constraints.

Return values

None.

Usage

In DDI 8, buf_breakup( ) is called outside the driver, before the biostart(D2) entry point is called.

In DDI versions 7 and earlier, buf_breakup is typically called in a block driver from its strategy(D2) entry point, which in turn is called indirectly through physiock(D3) from the driver's read(D2) and write(D2) entry points.

The strat routine should consider each call as a separate job, and should have no knowledge that an original buffer was broken up into multiple pieces.

The following buf(D4) fields will be copied from the original buffer header to any new buffer headers for each call to strat, in case the driver uses them to pass information into its lower-level routines:


b_priv
Driver private data

b_priv2
Driver private data

b_resid
Number of bytes not transferred

Context and synchronization

User or blockable context.

Hardware applicability

All

Version applicability

ddi: 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp

Differences between versions

Drivers that conform to DDI versions prior to version 8 and that call the buf_breakup( ) function should set D_NOBRKUP and D_BLKOFF in their devflag(D1) flags. Even though D_BLKOFF is set, the subordinate strategy routine, strat, will not see a non-zero b_blkoff if bcb_granularity is a multiple of NBPSCTR.

SCO OpenServer ODDI compatibility

ODDI drivers prior to version 3 call the dma_breakup(D3oddi) function to breakup DMA I/O requests or the pio_breakup(D3oddi) function to breakup programmed I/O requests. Beginning with ODDI version 3, these functions are called for the driver by the physio(D3oddi) function.

References

bcb(D4), buf(D4), devflag(D1), dma_pageio(D3), physiock(D3), rdma_filter(D3), read(D2), strategy(D2), write(D2)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005