biomodified(9f) [opensolaris man page]
biomodified(9F) Kernel Functions for Drivers biomodified(9F) NAME
biomodified - check if a buffer is modified SYNOPSIS
#include <sys/ddi.h> #include <sys/sunddi.h> intbiomodified(struct buf *bp); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
bp Pointer to the buffer header structure. DESCRIPTION
The biomodified() function returns status to indicate if the buffer is modified. The biomodified() function is only supported for paged- I/O request, that is the B_PAGEIO flag must be set in the b_flags field of the buf(9S) structure. The biomodified() function will check the memory pages associated with this buffer whether the Virtual Memory system's modification bit is set. If at least one of these pages is modified, the buffer is indicated as modified. A filesystem will mark the pages unmodified when it writes the pages to the backing store. The biomodified() function can be used to detect any modifications to the memory pages while I/O is in progress. A device driver can use biomodified() for disk mirroring. An application is allowed to mmap a file which can reside on a disk which is mirrored by multiple submirrors. If the file system writes the file to the backing store, it is written to all submirrors in parallel. It must be ensured that the copies on all submirrors are identical. The biomodified() function can be used in the device driver to detect any modifications to the buffer by the user program during the time the buffer is written to multiple submirrors. RETURN VALUES
The biomodified() function returns the following values: 1 Buffer is modified. 0 Buffer is not modified. -1 Buffer is not used for paged I/O request. CONTEXT
biomodified() can be called from any context. SEE ALSO
bp_mapin(9F), buf(9S) Writing Device Drivers SunOS 5.11 20 Nov 1996 biomodified(9F)
Check Out this Related Man Page
disksort(9F) Kernel Functions for Drivers disksort(9F) NAME
disksort - single direction elevator seek sort for buffers SYNOPSIS
#include <sys/conf.h> #include <sys/ddi.h> #include <sys/sunddi.h> void disksort(struct diskhd *dp, struct buf *bp); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
dp A pointer to a diskhd structure. A diskhd structure is essentially identical to head of a buffer structure (see buf(9S)). The only defined items of interest for this structure are the av_forw and av_back structure elements which are used to maintain the front and tail pointers of the forward linked I/O request queue. bp A pointer to a buffer structure. Typically this is the I/O request that the driver receives in its strategy routine (see strat- egy(9E)). The driver is responsible for initializing the b_resid structure element to a meaningful sort key value prior to calling disksort(). DESCRIPTION
The function disksort() sorts a pointer to a buffer into a single forward linked list headed by the av_forw element of the argument *dp. It uses a one-way elevator algorithm that sorts buffers into the queue in ascending order based upon a key value held in the argument buf- fer structure element b_resid. This value can either be the driver calculated cylinder number for the I/O request described by the buffer argument, or simply the absolute logical block for the I/O request, depending on how fine grained the sort is desired to be or how applicable either quantity is to the device in question. The head of the linked list is found by use of the av_forw structure element of the argument *dp. The tail of the linked list is found by use of the av_back structure element of the argument *dp. The av_forw element of the *bp argument is used by disksort() to maintain the forward linkage. The value at the head of the list presumably indicates the currently active disk area. CONTEXT
This function can be called from user or interrupt context. SEE ALSO
strategy(9E), buf(9S) Writing Device Drivers WARNINGS
disksort() does no locking. Therefore, any locking is completely the responsibility of the caller. SunOS 5.10 30 Jul 1993 disksort(9F)