RTEMS Logo

RTEMS 4.9.4 On-Line Library


mount

PREV UP NEXT Bookshelf RTEMS Filesystem Design Guide

4.20: mount

File:

mount.c

Arguments (Not a standard POSIX call):

rtems_filesystem_mount_table_entry_t **mt_entry,

If the mount operation is successful, this pointer to a pointer will be set to reference the mount table chain entry that has been allocated for this file system mount.

rtems_filesystem_operations_table *fs_ops,

This is a pointer to a table of functions that are associated with the file system that we are about to mount. This is the mechanism to selected file system type without keeping a dynamic database of all possible file system types that are valid for the mount operation. Using this method, it is only necessary to configure the filesystems that we wish to use into the RTEMS build. Unused filesystems types will not be drawn into the build.

char *fsoptions,

This argument points to a string that selects mounting for read only access or read/write access. Valid states are "RO" and "RW"

char *device,

This argument is reserved for the name of a device that will be used to access the filesystem information. Current filesystem implementations are memory based and do not require a device to access filesystem information.

char *mount_point

This is a pathname to a directory in a currently mounted filesystem that allows read, write and execute permissions. If successful, the node found by evaluating this name, is stored in the mt_entry.

Processing:

This routine will handle the mounting of a filesystem on a mount point. If the operation is successful, a pointer to the mount table chain entry associated with the mounted filesystem will be returned to the calling function. The specifics about the processing required at the mount point and within the filesystem being mounted is isolated in the filesystem specific mount() and fsmount_me() functions. This allows the generic mount() function to remain unaltered even if new filesystem types are introduced.

Development Comments:

This routine will use get_file_system_options() to determine if the mount options are valid ("RO" or "RW").

It confirms that a filesystem ops-table has been selected.

Space is allocated for a mount table entry and selective elements of the temporary mount table entry are initialized.

If a mount point is specified: The mount point is examined to determine that it is a directory and also has the appropriate permissions to allow a filesystem to be mounted.

The current mount table chain is searched to determine that there is not another filesystem mounted at the mount point we are trying to mount onto.

If a mount function is defined in the ops table for the filesystem containing the mount point, it is called at this time.

If no mount point is specified: Processing if performed to set up the mount table chain entry as the base filesystem.

If the fsmount_me() function is specified for ops-table of the filesystem being mounted, that function is called to initialize for the new filesystem.

On successful completion, the temporary mount table entry will be placed on the mount table chain to record the presence of the mounted filesystem.


PREV UP NEXT Bookshelf RTEMS Filesystem Design Guide

Copyright © 1988-2008 OAR Corporation