2 .\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH BIOMODIFIED 9F "Nov 20, 1996"
8 biomodified \- check if a buffer is modified
13 #include <sys/sunddi.h>
15 \fBint\fR \fBbiomodified\fR(\fBstruct buf *\fR\fIbp\fR);
21 Solaris DDI specific (Solaris DDI).
29 Pointer to the buffer header structure.
35 The \fBbiomodified()\fR function returns status to indicate if the buffer is
36 modified. The \fBbiomodified()\fR function is only supported for paged- \fBI/O
37 \fRrequest, that is the \fBB_PAGEIO\fRflag must be set in the \fIb_flags\fR
38 field of the \fBbuf\fR(9S) structure. The \fBbiomodified()\fR function will
39 check the memory pages associated with this buffer whether the Virtual Memory
40 system's modification bit is set. If at least one of these pages is modified,
41 the buffer is indicated as modified. A filesystem will mark the pages
42 \fBunmodified\fR when it writes the pages to the backing store. The
43 \fBbiomodified()\fR function can be used to detect any modifications to the
44 memory pages while \fBI/O \fRis in progress.
47 A device driver can use \fBbiomodified()\fR for disk mirroring. An application
48 is allowed to mmap a file which can reside on a disk which is mirrored by
49 multiple submirrors. If the file system writes the file to the backing store,
50 it is written to all submirrors in parallel. It must be ensured that the
51 copies on all submirrors are identical. The \fBbiomodified()\fR function can be
52 used in the device driver to detect any modifications to the buffer by the
53 user program during the time the buffer is written to multiple submirrors.
57 The \fBbiomodified()\fR function returns the following values:
73 Buffer is not modified.
82 Buffer is not used for paged \fBI/O\fR request.
88 \fBbiomodified()\fR can be called from any context.
92 \fBbp_mapin\fR(9F), \fBbuf\fR(9S)
95 \fIWriting Device Drivers\fR