1biomodified(9F)          Kernel Functions for Drivers          biomodified(9F)
2
3
4

NAME

6       biomodified - check if a buffer is modified
7

SYNOPSIS

9       #include <sys/ddi.h>
10       #include <sys/sunddi.h>
11
12       int biomodified(struct buf *bp);
13
14

INTERFACE LEVEL

16       Solaris DDI specific (Solaris DDI).
17

PARAMETERS

19       bp    Pointer to the buffer header structure.
20
21

DESCRIPTION

23       The  biomodified() function returns status to indicate if the buffer is
24       modified. The  biomodified() function is only supported for paged-  I/O
25       request,  that  is the B_PAGEIOflag must be set in the b_flags field of
26       the buf(9S) structure.  The  biomodified() function will check the mem‐
27       ory  pages  associated with this buffer whether the Virtual Memory sys‐
28       tem's modification bit is set.  If at least one of these pages is modi‐
29       fied,  the buffer is indicated as modified.  A filesystem will mark the
30       pages  unmodified when it writes the pages to the backing  store.   The
31       biomodified()  function  can be used to detect any modifications to the
32       memory pages while I/O is in progress.
33
34
35       A device driver can use biomodified() for disk mirroring.  An  applica‐
36       tion  is  allowed  to  mmap a file which can  reside on a disk which is
37       mirrored by multiple submirrors. If the file system writes the file  to
38       the  backing  store,  it  is written to all  submirrors in parallel. It
39       must be ensured that the copies on all submirrors  are  identical.  The
40       biomodified()  function  can be used in the device driver to detect any
41       modifications to  the buffer by the user program during  the  time  the
42       buffer is written to multiple submirrors.
43

RETURN VALUES

45       The  biomodified() function returns the following values:
46
47       1     Buffer is modified.
48
49
50       0     Buffer is not modified.
51
52
53       -1    Buffer is not used for paged I/O request.
54
55

CONTEXT

57       biomodified() can be called from any context.
58

SEE ALSO

60       bp_mapin(9F), buf(9S)
61
62
63       Writing Device Drivers
64
65
66
67SunOS 5.11                        20 Nov 1996                  biomodified(9F)
Impressum