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 >Initialization and Mounting</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
25 TITLE="Synchronization"
26 HREF="fileio-synchronization.html"><LINK
29 HREF="fileio-sockets.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="fileio-synchronization.html"
71 HREF="fileio-sockets.html"
84 NAME="FILEIO-MOUNTING">Chapter 25. Initialization and Mounting</H1
86 >As mentioned previously, mount table entries can be sourced from two
87 places. Static entries may be defined by using the
91 > macro. Such entries will be
92 automatically mounted on system startup. For each entry in the mount
93 table that has a non-null <TT
99 filesystem table is searched for a match with the
105 > field. If a match is found the
111 > entry is called and if
112 successful the mount table entry marked valid and the
118 > field initialized. The
122 > function is responsible for initializing
130 >The size of the mount table is defined by the configuration value
133 >CYGNUM_FILEIO_MTAB_MAX</TT
134 >. Any entries that have not
135 been statically defined are available for use by dynamic mounts.</P
137 >A filesystem may be mounted dynamically by calling <TT
141 function has the following prototype:</P
149 CLASS="PROGRAMLISTING"
150 >int mount( const char *devname,
152 const char *fsname);</PRE
162 > argument identifies a device that
163 will be used by this filesystem and will be assigned to the
169 > field of the mount table entry.</P
176 > argument is the mount point name, it
177 will be assigned to the <TT
183 mount table entry.</P
190 > argument is the name of the
191 implementing filesystem, it will be assigned to the
197 > entry of the mount table entry.</P
199 >The process of mounting a filesystem dynamically is as follows. First
200 a search is made of the mount table for an entry with a NULL
206 > field to be used for the new mount
207 point. The filesystem table is then searched for an entry whose name
213 >. If this is successful then
214 the mount table entry is initialized and the filesystem's
218 > operation called. If this is successful,
219 the mount table entry is marked valid and the
225 > field initialized.</P
227 >Unmounting a filesystem is done by the <TT
231 function. This can unmount filesystems whether they were mounted
232 statically or dynamically.</P
237 > function has the following prototype:</P
245 CLASS="PROGRAMLISTING"
246 >int umount( const char *name );</PRE
251 >The mount table is searched for a match between the
257 > argument and the entry
263 > field. When a match is found the
267 > operation is called and if
268 successful, the mount table entry is invalidated by setting its
274 > field false and the
287 SUMMARY="Footer navigation table"
298 HREF="fileio-synchronization.html"
316 HREF="fileio-sockets.html"