]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - doc/html/ref/fileio-synchronization.html
Initial revision
[karo-tx-redboot.git] / doc / html / ref / fileio-synchronization.html
1 <!-- Copyright (C) 2003 Red Hat, Inc.                                -->
2 <!-- This material may be distributed only subject to the terms      -->
3 <!-- and conditions set forth in the Open Publication License, v1.0  -->
4 <!-- or later (the latest version is presently available at          -->
5 <!-- http://www.opencontent.org/openpub/).                           -->
6 <!-- Distribution of the work or derivative of the work in any       -->
7 <!-- standard (paper) book form is prohibited unless prior           -->
8 <!-- permission is obtained from the copyright holder.               -->
9 <HTML
10 ><HEAD
11 ><TITLE
12 >Synchronization</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
14 <META
15 NAME="GENERATOR"
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
17 "><LINK
18 REL="HOME"
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
21 REL="UP"
22 TITLE="File System Support Infrastructure"
23 HREF="fileio.html"><LINK
24 REL="PREVIOUS"
25 TITLE="Directories"
26 HREF="fileio-directories.html"><LINK
27 REL="NEXT"
28 TITLE="Initialization and Mounting"
29 HREF="fileio-mounting.html"></HEAD
30 ><BODY
31 CLASS="CHAPTER"
32 BGCOLOR="#FFFFFF"
33 TEXT="#000000"
34 LINK="#0000FF"
35 VLINK="#840084"
36 ALINK="#0000FF"
37 ><DIV
38 CLASS="NAVHEADER"
39 ><TABLE
40 SUMMARY="Header navigation table"
41 WIDTH="100%"
42 BORDER="0"
43 CELLPADDING="0"
44 CELLSPACING="0"
45 ><TR
46 ><TH
47 COLSPAN="3"
48 ALIGN="center"
49 >eCos Reference Manual</TH
50 ></TR
51 ><TR
52 ><TD
53 WIDTH="10%"
54 ALIGN="left"
55 VALIGN="bottom"
56 ><A
57 HREF="fileio-directories.html"
58 ACCESSKEY="P"
59 >Prev</A
60 ></TD
61 ><TD
62 WIDTH="80%"
63 ALIGN="center"
64 VALIGN="bottom"
65 ></TD
66 ><TD
67 WIDTH="10%"
68 ALIGN="right"
69 VALIGN="bottom"
70 ><A
71 HREF="fileio-mounting.html"
72 ACCESSKEY="N"
73 >Next</A
74 ></TD
75 ></TR
76 ></TABLE
77 ><HR
78 ALIGN="LEFT"
79 WIDTH="100%"></DIV
80 ><DIV
81 CLASS="CHAPTER"
82 ><H1
83 ><A
84 NAME="FILEIO-SYNCHRONIZATION">Chapter 24. Synchronization</H1
85 ><P
86 >The FILEIO infrastructure provides a synchronization mechanism for
87 controlling concurrent access to filesystems. This allows existing
88 filesystems to be ported to eCos, even if they do not have their own
89 synchronization mechanisms. It also allows new filesystems to be
90 implemented easily without having to consider the synchronization
91 issues.</P
92 ><P
93 >The infrastructure maintains a mutex for each entry in each of
94 the main tables: filesystem table, mount table and file table. For
95 each class of operation each of these mutexes may be locked before the
96 corresponding filesystem operation is invoked.</P
97 ><P
98 >The synchronization protocol required by a filesystem is described
99 by the <TT
100 CLASS="STRUCTFIELD"
101 ><I
102 >syncmode</I
103 ></TT
104 > field of the filesystem
105 table entry. This is a combination of the following flags:</P
106 ><P
107 ></P
108 ><DIV
109 CLASS="VARIABLELIST"
110 ><DL
111 ><DT
112 ><TT
113 CLASS="LITERAL"
114 >CYG_SYNCMODE_FILE_FILESYSTEM</TT
115 ></DT
116 ><DD
117 ><P
118 >Lock the filesystem table entry mutex
119 during all filesystem level operations.</P
120 ></DD
121 ><DT
122 ><TT
123 CLASS="LITERAL"
124 >CYG_SYNCMODE_FILE_MOUNTPOINT</TT
125 ></DT
126 ><DD
127 ><P
128 >Lock the mount table entry mutex
129 during all filesystem level operations.</P
130 ></DD
131 ><DT
132 ><TT
133 CLASS="LITERAL"
134 >CYG_SYNCMODE_IO_FILE</TT
135 ></DT
136 ><DD
137 ><P
138 >Lock the file table entry mutex during all
139 I/O operations.</P
140 ></DD
141 ><DT
142 ><TT
143 CLASS="LITERAL"
144 >CYG_SYNCMODE_IO_FILESYSTEM</TT
145 ></DT
146 ><DD
147 ><P
148 >Lock the filesystem table entry mutex during all I/O operations.</P
149 ></DD
150 ><DT
151 ><TT
152 CLASS="LITERAL"
153 >CYG_SYNCMODE_IO_MOUNTPOINT</TT
154 ></DT
155 ><DD
156 ><P
157 >Lock the mount table entry mutex during all I/O operations.</P
158 ></DD
159 ><DT
160 ><TT
161 CLASS="LITERAL"
162 >CYG_SYNCMODE_SOCK_FILE</TT
163 ></DT
164 ><DD
165 ><P
166 >Lock the file table entry mutex during all socket operations.</P
167 ></DD
168 ><DT
169 ><TT
170 CLASS="LITERAL"
171 >CYG_SYNCMODE_SOCK_NETSTACK</TT
172 ></DT
173 ><DD
174 ><P
175 >Lock the network stack table entry mutex during all socket operations.</P
176 ></DD
177 ><DT
178 ><TT
179 CLASS="LITERAL"
180 >CYG_SYNCMODE_NONE</TT
181 ></DT
182 ><DD
183 ><P
184 >Perform no locking at all during any operations.</P
185 ></DD
186 ></DL
187 ></DIV
188 ><P
189 >The value of the <TT
190 CLASS="STRUCTFIELD"
191 ><I
192 >syncmode</I
193 ></TT
194 > field in the
195 filesystem table entry will be copied by the infrastructure to the
196 open file object after a successful <TT
197 CLASS="FUNCTION"
198 >open()</TT
199 > operation.</P
200 ></DIV
201 ><DIV
202 CLASS="NAVFOOTER"
203 ><HR
204 ALIGN="LEFT"
205 WIDTH="100%"><TABLE
206 SUMMARY="Footer navigation table"
207 WIDTH="100%"
208 BORDER="0"
209 CELLPADDING="0"
210 CELLSPACING="0"
211 ><TR
212 ><TD
213 WIDTH="33%"
214 ALIGN="left"
215 VALIGN="top"
216 ><A
217 HREF="fileio-directories.html"
218 ACCESSKEY="P"
219 >Prev</A
220 ></TD
221 ><TD
222 WIDTH="34%"
223 ALIGN="center"
224 VALIGN="top"
225 ><A
226 HREF="ecos-ref.html"
227 ACCESSKEY="H"
228 >Home</A
229 ></TD
230 ><TD
231 WIDTH="33%"
232 ALIGN="right"
233 VALIGN="top"
234 ><A
235 HREF="fileio-mounting.html"
236 ACCESSKEY="N"
237 >Next</A
238 ></TD
239 ></TR
240 ><TR
241 ><TD
242 WIDTH="33%"
243 ALIGN="left"
244 VALIGN="top"
245 >Directories</TD
246 ><TD
247 WIDTH="34%"
248 ALIGN="center"
249 VALIGN="top"
250 ><A
251 HREF="fileio.html"
252 ACCESSKEY="U"
253 >Up</A
254 ></TD
255 ><TD
256 WIDTH="33%"
257 ALIGN="right"
258 VALIGN="top"
259 >Initialization and Mounting</TD
260 ></TR
261 ></TABLE
262 ></DIV
263 ></BODY
264 ></HTML
265 >