Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / biomodified.9f
blob8cba5a3d399dfab7df257dc334a834c67d3f6824
1 '\" te
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"
7 .SH NAME
8 biomodified \- check if a buffer is modified
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/ddi.h>
13 #include <sys/sunddi.h>
15 \fBint\fR \fBbiomodified\fR(\fBstruct buf *\fR\fIbp\fR);
16 .fi
18 .SH INTERFACE LEVEL
19 .sp
20 .LP
21 Solaris DDI specific (Solaris DDI).
22 .SH PARAMETERS
23 .sp
24 .ne 2
25 .na
26 \fB\fIbp\fR\fR
27 .ad
28 .RS 6n
29 Pointer to the buffer header structure.
30 .RE
32 .SH DESCRIPTION
33 .sp
34 .LP
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.
45 .sp
46 .LP
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.
54 .SH RETURN VALUES
55 .sp
56 .LP
57 The  \fBbiomodified()\fR function returns the following values:
58 .sp
59 .ne 2
60 .na
61 \fB\fB1\fR\fR
62 .ad
63 .RS 6n
64 Buffer is modified.
65 .RE
67 .sp
68 .ne 2
69 .na
70 \fB\fB0\fR\fR
71 .ad
72 .RS 6n
73 Buffer is not modified.
74 .RE
76 .sp
77 .ne 2
78 .na
79 \fB\fB-1\fR\fR
80 .ad
81 .RS 6n
82 Buffer is not used for paged \fBI/O\fR request.
83 .RE
85 .SH CONTEXT
86 .sp
87 .LP
88 \fBbiomodified()\fR can be called from any context.
89 .SH SEE ALSO
90 .sp
91 .LP
92 \fBbp_mapin\fR(9F), \fBbuf\fR(9S)
93 .sp
94 .LP
95 \fIWriting Device Drivers\fR