OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [html/] [ref/] [fileio-mounting.html] - Diff between revs 28 and 174

Only display areas with differences | Details | Blame | View Log

Rev 28 Rev 174
<!-- Copyright (C) 2003 Red Hat, Inc.                                -->
<!-- Copyright (C) 2003 Red Hat, Inc.                                -->
<!-- This material may be distributed only subject to the terms      -->
<!-- This material may be distributed only subject to the terms      -->
<!-- and conditions set forth in the Open Publication License, v1.0  -->
<!-- and conditions set forth in the Open Publication License, v1.0  -->
<!-- or later (the latest version is presently available at          -->
<!-- or later (the latest version is presently available at          -->
<!-- http://www.opencontent.org/openpub/).                           -->
<!-- http://www.opencontent.org/openpub/).                           -->
<!-- Distribution of the work or derivative of the work in any       -->
<!-- Distribution of the work or derivative of the work in any       -->
<!-- standard (paper) book form is prohibited unless prior           -->
<!-- standard (paper) book form is prohibited unless prior           -->
<!-- permission is obtained from the copyright holder.               -->
<!-- permission is obtained from the copyright holder.               -->
<HTML
<HTML
><HEAD
><HEAD
><TITLE
><TITLE
>Initialization and Mounting</TITLE
>Initialization and Mounting</TITLE
><meta name="MSSmartTagsPreventParsing" content="TRUE">
><meta name="MSSmartTagsPreventParsing" content="TRUE">
<META
<META
NAME="GENERATOR"
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
"><LINK
REL="HOME"
REL="HOME"
TITLE="eCos Reference Manual"
TITLE="eCos Reference Manual"
HREF="ecos-ref.html"><LINK
HREF="ecos-ref.html"><LINK
REL="UP"
REL="UP"
TITLE="File System Support Infrastructure"
TITLE="File System Support Infrastructure"
HREF="fileio.html"><LINK
HREF="fileio.html"><LINK
REL="PREVIOUS"
REL="PREVIOUS"
TITLE="Synchronization"
TITLE="Synchronization"
HREF="fileio-synchronization.html"><LINK
HREF="fileio-synchronization.html"><LINK
REL="NEXT"
REL="NEXT"
TITLE="Sockets"
TITLE="Sockets"
HREF="fileio-sockets.html"></HEAD
HREF="fileio-sockets.html"></HEAD
><BODY
><BODY
CLASS="CHAPTER"
CLASS="CHAPTER"
BGCOLOR="#FFFFFF"
BGCOLOR="#FFFFFF"
TEXT="#000000"
TEXT="#000000"
LINK="#0000FF"
LINK="#0000FF"
VLINK="#840084"
VLINK="#840084"
ALINK="#0000FF"
ALINK="#0000FF"
><DIV
><DIV
CLASS="NAVHEADER"
CLASS="NAVHEADER"
><TABLE
><TABLE
SUMMARY="Header navigation table"
SUMMARY="Header navigation table"
WIDTH="100%"
WIDTH="100%"
BORDER="0"
BORDER="0"
CELLPADDING="0"
CELLPADDING="0"
CELLSPACING="0"
CELLSPACING="0"
><TR
><TR
><TH
><TH
COLSPAN="3"
COLSPAN="3"
ALIGN="center"
ALIGN="center"
>eCos Reference Manual</TH
>eCos Reference Manual</TH
></TR
></TR
><TR
><TR
><TD
><TD
WIDTH="10%"
WIDTH="10%"
ALIGN="left"
ALIGN="left"
VALIGN="bottom"
VALIGN="bottom"
><A
><A
HREF="fileio-synchronization.html"
HREF="fileio-synchronization.html"
ACCESSKEY="P"
ACCESSKEY="P"
>Prev</A
>Prev</A
></TD
></TD
><TD
><TD
WIDTH="80%"
WIDTH="80%"
ALIGN="center"
ALIGN="center"
VALIGN="bottom"
VALIGN="bottom"
></TD
></TD
><TD
><TD
WIDTH="10%"
WIDTH="10%"
ALIGN="right"
ALIGN="right"
VALIGN="bottom"
VALIGN="bottom"
><A
><A
HREF="fileio-sockets.html"
HREF="fileio-sockets.html"
ACCESSKEY="N"
ACCESSKEY="N"
>Next</A
>Next</A
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><HR
><HR
ALIGN="LEFT"
ALIGN="LEFT"
WIDTH="100%"></DIV
WIDTH="100%"></DIV
><DIV
><DIV
CLASS="CHAPTER"
CLASS="CHAPTER"
><H1
><H1
><A
><A
NAME="FILEIO-MOUNTING">Chapter 25. Initialization and Mounting</H1
NAME="FILEIO-MOUNTING">Chapter 25. Initialization and Mounting</H1
><P
><P
>As mentioned previously, mount table entries can be sourced from two
>As mentioned previously, mount table entries can be sourced from two
places. Static entries may be defined by using the
places. Static entries may be defined by using the
<TT
<TT
CLASS="LITERAL"
CLASS="LITERAL"
>MTAB_ENTRY()</TT
>MTAB_ENTRY()</TT
> macro. Such entries will be
> macro. Such entries will be
automatically mounted on system startup.  For each entry in the mount
automatically mounted on system startup.  For each entry in the mount
table that has a non-null <TT
table that has a non-null <TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>name</I
>name</I
></TT
></TT
> field the
> field the
filesystem table is searched for a match with the
filesystem table is searched for a match with the
<TT
<TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>fsname</I
>fsname</I
></TT
></TT
> field. If a match is found the
> field. If a match is found the
filesystem's <TT
filesystem's <TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>mount</I
>mount</I
></TT
></TT
> entry is called and if
> entry is called and if
successful the mount table entry marked valid and the
successful the mount table entry marked valid and the
<TT
<TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>fs</I
>fs</I
></TT
></TT
> field initialized. The
> field initialized. The
<TT
<TT
CLASS="FUNCTION"
CLASS="FUNCTION"
>mount()</TT
>mount()</TT
> function is responsible for initializing
> function is responsible for initializing
the <TT
the <TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>root</I
>root</I
></TT
></TT
> field.</P
> field.</P
><P
><P
>The size of the mount table is defined by the configuration value
>The size of the mount table is defined by the configuration value
<TT
<TT
CLASS="LITERAL"
CLASS="LITERAL"
>CYGNUM_FILEIO_MTAB_MAX</TT
>CYGNUM_FILEIO_MTAB_MAX</TT
>. Any entries that have not
>. Any entries that have not
been statically defined are available for use by dynamic mounts.</P
been statically defined are available for use by dynamic mounts.</P
><P
><P
>A filesystem may be mounted dynamically by calling <TT
>A filesystem may be mounted dynamically by calling <TT
CLASS="FUNCTION"
CLASS="FUNCTION"
>mount()</TT
>mount()</TT
>. This
>. This
function has the following prototype:</P
function has the following prototype:</P
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>int mount( const char *devname,
>int mount( const char *devname,
           const char *dir,
           const char *dir,
           const char *fsname);</PRE
           const char *fsname);</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>The <TT
>The <TT
CLASS="PARAMETER"
CLASS="PARAMETER"
><I
><I
>devname</I
>devname</I
></TT
></TT
> argument identifies a device that
> argument identifies a device that
will be used by this filesystem and will be assigned to the
will be used by this filesystem and will be assigned to the
<TT
<TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>devname</I
>devname</I
></TT
></TT
> field of the mount table entry.</P
> field of the mount table entry.</P
><P
><P
>The <TT
>The <TT
CLASS="PARAMETER"
CLASS="PARAMETER"
><I
><I
>dir</I
>dir</I
></TT
></TT
> argument is the mount point name, it
> argument is the mount point name, it
will be assigned to the <TT
will be assigned to the <TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>name</I
>name</I
></TT
></TT
> field of the
> field of the
mount table entry.</P
mount table entry.</P
><P
><P
>The <TT
>The <TT
CLASS="PARAMETER"
CLASS="PARAMETER"
><I
><I
>fsname</I
>fsname</I
></TT
></TT
> argument is the name of the
> argument is the name of the
implementing filesystem, it will be assigned to the
implementing filesystem, it will be assigned to the
<TT
<TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>fsname</I
>fsname</I
></TT
></TT
> entry of the mount table entry.</P
> entry of the mount table entry.</P
><P
><P
>The process of mounting a filesystem dynamically is as follows. First
>The process of mounting a filesystem dynamically is as follows. First
a search is made of the mount table for an entry with a NULL
a search is made of the mount table for an entry with a NULL
<TT
<TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>name</I
>name</I
></TT
></TT
> field to be used for the new mount
> field to be used for the new mount
point. The filesystem table is then searched for an entry whose name
point. The filesystem table is then searched for an entry whose name
matches <TT
matches <TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>fsname</I
>fsname</I
></TT
></TT
>. If this is successful then
>. If this is successful then
the mount table entry is initialized and the filesystem's
the mount table entry is initialized and the filesystem's
<TT
<TT
CLASS="FUNCTION"
CLASS="FUNCTION"
>mount()</TT
>mount()</TT
> operation called. If this is successful,
> operation called. If this is successful,
the mount table entry is marked valid and the
the mount table entry is marked valid and the
<TT
<TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>fs</I
>fs</I
></TT
></TT
> field initialized.</P
> field initialized.</P
><P
><P
>Unmounting a filesystem is done by the <TT
>Unmounting a filesystem is done by the <TT
CLASS="FUNCTION"
CLASS="FUNCTION"
>umount()</TT
>umount()</TT
>
>
function. This can unmount filesystems whether they were mounted
function. This can unmount filesystems whether they were mounted
statically or dynamically.</P
statically or dynamically.</P
><P
><P
>The <TT
>The <TT
CLASS="FUNCTION"
CLASS="FUNCTION"
>umount()</TT
>umount()</TT
> function has the following prototype:</P
> function has the following prototype:</P
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>int umount( const char *name );</PRE
>int umount( const char *name );</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>The mount table is searched for a match between the
>The mount table is searched for a match between the
<TT
<TT
CLASS="PARAMETER"
CLASS="PARAMETER"
><I
><I
>name</I
>name</I
></TT
></TT
> argument and the entry
> argument and the entry
<TT
<TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>name</I
>name</I
></TT
></TT
> field. When a match is found the
> field. When a match is found the
filesystem's <TT
filesystem's <TT
CLASS="FUNCTION"
CLASS="FUNCTION"
>umount()</TT
>umount()</TT
> operation is called and if
> operation is called and if
successful, the mount table entry is invalidated by setting its
successful, the mount table entry is invalidated by setting its
<TT
<TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>valid</I
>valid</I
></TT
></TT
> field false and the
> field false and the
<TT
<TT
CLASS="STRUCTFIELD"
CLASS="STRUCTFIELD"
><I
><I
>name</I
>name</I
></TT
></TT
> field to NULL.</P
> field to NULL.</P
></DIV
></DIV
><DIV
><DIV
CLASS="NAVFOOTER"
CLASS="NAVFOOTER"
><HR
><HR
ALIGN="LEFT"
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
SUMMARY="Footer navigation table"
WIDTH="100%"
WIDTH="100%"
BORDER="0"
BORDER="0"
CELLPADDING="0"
CELLPADDING="0"
CELLSPACING="0"
CELLSPACING="0"
><TR
><TR
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="left"
ALIGN="left"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="fileio-synchronization.html"
HREF="fileio-synchronization.html"
ACCESSKEY="P"
ACCESSKEY="P"
>Prev</A
>Prev</A
></TD
></TD
><TD
><TD
WIDTH="34%"
WIDTH="34%"
ALIGN="center"
ALIGN="center"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="ecos-ref.html"
HREF="ecos-ref.html"
ACCESSKEY="H"
ACCESSKEY="H"
>Home</A
>Home</A
></TD
></TD
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="right"
ALIGN="right"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="fileio-sockets.html"
HREF="fileio-sockets.html"
ACCESSKEY="N"
ACCESSKEY="N"
>Next</A
>Next</A
></TD
></TD
></TR
></TR
><TR
><TR
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="left"
ALIGN="left"
VALIGN="top"
VALIGN="top"
>Synchronization</TD
>Synchronization</TD
><TD
><TD
WIDTH="34%"
WIDTH="34%"
ALIGN="center"
ALIGN="center"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="fileio.html"
HREF="fileio.html"
ACCESSKEY="U"
ACCESSKEY="U"
>Up</A
>Up</A
></TD
></TD
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="right"
ALIGN="right"
VALIGN="top"
VALIGN="top"
>Sockets</TD
>Sockets</TD
></TR
></TR
></TABLE
></TABLE
></DIV
></DIV
></BODY
></BODY
></HTML
></HTML
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.