]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - doc/html/ref/fileio-fstab.html
Initial revision
[karo-tx-redboot.git] / doc / html / ref / fileio-fstab.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 >File System Table</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="Introduction"
26 HREF="fileio-intro.html"><LINK
27 REL="NEXT"
28 TITLE="Mount Table"
29 HREF="fileio-mount-table.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-intro.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-mount-table.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-FSTAB">Chapter 20. File System Table</H1
85 ><P
86 >The filesystem table is an array of entries that describe each
87 filesystem implementation that is part of the system image. Each
88 resident filesystem should export an entry to this table using the
89 <TT
90 CLASS="LITERAL"
91 >FSTAB_ENTRY()</TT
92 > macro.</P
93 ><DIV
94 CLASS="NOTE"
95 ><BLOCKQUOTE
96 CLASS="NOTE"
97 ><P
98 ><B
99 >Note: </B
100 >At present we do not support dynamic addition or removal of table
101 entries. However, an API similar to <TT
102 CLASS="FUNCTION"
103 >mount()</TT
104 > would
105 allow new entries to be added to the table.</P
106 ></BLOCKQUOTE
107 ></DIV
108 ><P
109 >The table entries are described by the following structure:</P
110 ><TABLE
111 BORDER="5"
112 BGCOLOR="#E0E0F0"
113 WIDTH="70%"
114 ><TR
115 ><TD
116 ><PRE
117 CLASS="PROGRAMLISTING"
118 >struct cyg_fstab_entry
119 {
120     const char          *name;          // filesystem name
121     CYG_ADDRWORD        data;           // private data value
122     cyg_uint32          syncmode;       // synchronization mode
123     
124     int     (*mount)    ( cyg_fstab_entry *fste, cyg_mtab_entry *mte );
125     int     (*umount)   ( cyg_mtab_entry *mte );
126     int     (*open)     ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
127                           int mode,  cyg_file *fte );
128     int     (*unlink)   ( cyg_mtab_entry *mte, cyg_dir dir, const char *name );
129     int     (*mkdir)    ( cyg_mtab_entry *mte, cyg_dir dir, const char *name );
130     int     (*rmdir)    ( cyg_mtab_entry *mte, cyg_dir dir, const char *name );
131     int     (*rename)   ( cyg_mtab_entry *mte, cyg_dir dir1, const char *name1,
132                           cyg_dir dir2, const char *name2 );
133     int     (*link)     ( cyg_mtab_entry *mte, cyg_dir dir1, const char *name1,
134                           cyg_dir dir2, const char *name2, int type );
135     int     (*opendir)  ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
136                           cyg_file *fte );
137     int     (*chdir)    ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
138                           cyg_dir *dir_out );
139     int     (*stat)     ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
140                           struct stat *buf);
141     int     (*getinfo)  ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
142                           int key, char *buf, int len );
143     int     (*setinfo)  ( cyg_mtab_entry *mte, cyg_dir dir, const char *name,
144                           int key, char *buf, int len );
145 };</PRE
146 ></TD
147 ></TR
148 ></TABLE
149 ><P
150 >The <TT
151 CLASS="STRUCTFIELD"
152 ><I
153 >name</I
154 ></TT
155 > field points to a string that
156 identifies this filesystem implementation. Typical values might be
157 &quot;romfs&quot;, &quot;msdos&quot;, &quot;ext2&quot; etc.</P
158 ><P
159 >The <TT
160 CLASS="STRUCTFIELD"
161 ><I
162 >data</I
163 ></TT
164 > field contains any private data
165 that the filesystem needs, perhaps the root of its data structures.</P
166 ><P
167 >The <TT
168 CLASS="STRUCTFIELD"
169 ><I
170 >syncmode</I
171 ></TT
172 > field contains a description of
173 the locking protocol to be used when accessing this filesystem. It
174 will be described in more detail in <A
175 HREF="fileio-synchronization.html"
176 >Chapter 24</A
177 >.</P
178 ><P
179 >The remaining fields are pointers to functions that implement
180 filesystem operations that apply to files and directories as whole
181 objects. The operation implemented by each function should be obvious
182 from the names, with a few exceptions:</P
183 ><P
184 >The <TT
185 CLASS="FUNCTION"
186 >opendir()</TT
187 > function pointer opens a directory
188 for reading. See <A
189 HREF="fileio-directories.html"
190 >Chapter 23</A
191 > for details.</P
192 ><P
193 >The <TT
194 CLASS="FUNCTION"
195 >getinfo()</TT
196 > and
197 <TT
198 CLASS="FUNCTION"
199 >setinfo()</TT
200 > function pointers provide support for
201 various minor control and information functions such as
202 <TT
203 CLASS="FUNCTION"
204 >pathconf()</TT
205 > and <TT
206 CLASS="FUNCTION"
207 >access()</TT
208 >.</P
209 ><P
210 >With the exception of the <TT
211 CLASS="FUNCTION"
212 >mount()</TT
213 > and
214 <TT
215 CLASS="FUNCTION"
216 >umount()</TT
217 > functions, all of these functions
218 take three standard arguments, a pointer to a mount table entry (see
219 later) a directory pointer (also see later) and a file name relative
220 to the directory. These should be used by the filesystem to locate the
221 object of interest.</P
222 ></DIV
223 ><DIV
224 CLASS="NAVFOOTER"
225 ><HR
226 ALIGN="LEFT"
227 WIDTH="100%"><TABLE
228 SUMMARY="Footer navigation table"
229 WIDTH="100%"
230 BORDER="0"
231 CELLPADDING="0"
232 CELLSPACING="0"
233 ><TR
234 ><TD
235 WIDTH="33%"
236 ALIGN="left"
237 VALIGN="top"
238 ><A
239 HREF="fileio-intro.html"
240 ACCESSKEY="P"
241 >Prev</A
242 ></TD
243 ><TD
244 WIDTH="34%"
245 ALIGN="center"
246 VALIGN="top"
247 ><A
248 HREF="ecos-ref.html"
249 ACCESSKEY="H"
250 >Home</A
251 ></TD
252 ><TD
253 WIDTH="33%"
254 ALIGN="right"
255 VALIGN="top"
256 ><A
257 HREF="fileio-mount-table.html"
258 ACCESSKEY="N"
259 >Next</A
260 ></TD
261 ></TR
262 ><TR
263 ><TD
264 WIDTH="33%"
265 ALIGN="left"
266 VALIGN="top"
267 >Introduction</TD
268 ><TD
269 WIDTH="34%"
270 ALIGN="center"
271 VALIGN="top"
272 ><A
273 HREF="fileio.html"
274 ACCESSKEY="U"
275 >Up</A
276 ></TD
277 ><TD
278 WIDTH="33%"
279 ALIGN="right"
280 VALIGN="top"
281 >Mount Table</TD
282 ></TR
283 ></TABLE
284 ></DIV
285 ></BODY
286 ></HTML
287 >