'\" te .\" Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. .TH biomodified 9F "21 Dec 2010" "SunOS 5.11" "Kernel Functions for Drivers" .SH NAME biomodified \- check if a buffer is modified .SH SYNOPSIS .LP .nf #include #include \fBint\fR \fBbiomodified\fR(\fBstruct buf *\fR\fIbp\fR); .fi .SH INTERFACE LEVEL .sp .LP Solaris DDI specific (Solaris DDI). .SH PARAMETERS .sp .ne 2 .mk .na \fB\fIbp\fR\fR .ad .RS 6n .rt Pointer to the buffer header structure. .RE .SH DESCRIPTION .sp .LP The \fBbiomodified()\fR function returns status to indicate if the memory associated with a \fBbuf\fR(9S) structure is modified. The \fBbiomodified()\fR function may only be supported for some types of \fBbuf\fR structures (like a paged-I/O request). If called on an unsupported \fBbuf\fR structure, \(em1 is returned. The \fBbiomodified()\fR function will check the memory pages associated with a buffer and determine 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 \fBunmodified\fR when it writes the pages to the backing store. The \fBbiomodified()\fR function can be used to detect any modifications to the memory pages while I/O is in progress. .sp .LP A device driver can use \fBbiomodified()\fR 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 \fBbiomodified()\fR 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. .SH RETURN VALUES .sp .LP The \fBbiomodified()\fR function returns the following values: .sp .ne 2 .mk .na \fB\fB1\fR\fR .ad .RS 6n .rt Buffer is modified. .RE .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .RS 6n .rt Buffer is not modified. .RE .sp .ne 2 .mk .na \fB\fB-1\fR\fR .ad .RS 6n .rt Unknown whether buffer is modifiedt. .RE .SH CONTEXT .sp .LP \fBbiomodified()\fR can be called from any context. .SH SEE ALSO .sp .LP \fBbioaligned\fR(9F), \fBbp_mapin\fR(9F), \fBbuf\fR(9S) .sp .LP \fIWriting Device Drivers for Oracle Solaris 11.2\fR