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. -->
12 >Synchronization</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="File System Support Infrastructure"
23 HREF="fileio.html"><LINK
26 HREF="fileio-directories.html"><LINK
28 TITLE="Initialization and Mounting"
29 HREF="fileio-mounting.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="fileio-directories.html"
71 HREF="fileio-mounting.html"
84 NAME="FILEIO-SYNCHRONIZATION">Chapter 24. Synchronization</H1
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
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
98 >The synchronization protocol required by a filesystem is described
104 > field of the filesystem
105 table entry. This is a combination of the following flags:</P
114 >CYG_SYNCMODE_FILE_FILESYSTEM</TT
118 >Lock the filesystem table entry mutex
119 during all filesystem level operations.</P
124 >CYG_SYNCMODE_FILE_MOUNTPOINT</TT
128 >Lock the mount table entry mutex
129 during all filesystem level operations.</P
134 >CYG_SYNCMODE_IO_FILE</TT
138 >Lock the file table entry mutex during all
144 >CYG_SYNCMODE_IO_FILESYSTEM</TT
148 >Lock the filesystem table entry mutex during all I/O operations.</P
153 >CYG_SYNCMODE_IO_MOUNTPOINT</TT
157 >Lock the mount table entry mutex during all I/O operations.</P
162 >CYG_SYNCMODE_SOCK_FILE</TT
166 >Lock the file table entry mutex during all socket operations.</P
171 >CYG_SYNCMODE_SOCK_NETSTACK</TT
175 >Lock the network stack table entry mutex during all socket operations.</P
180 >CYG_SYNCMODE_NONE</TT
184 >Perform no locking at all during any operations.</P
189 >The value of the <TT
195 filesystem table entry will be copied by the infrastructure to the
196 open file object after a successful <TT
206 SUMMARY="Footer navigation table"
217 HREF="fileio-directories.html"
235 HREF="fileio-mounting.html"
259 >Initialization and Mounting</TD