summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/imfs
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2010-05-31 13:56:37 +0000
committerChris Johns <chrisj@rtems.org>2010-05-31 13:56:37 +0000
commit29e92b090c8bc35745aa5c89231ce806bcb11e57 (patch)
treea253c33b1654609acfbd5216797976dce3b0748f /cpukit/libfs/src/imfs
parent2010-05-31 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff)
downloadrtems-29e92b090c8bc35745aa5c89231ce806bcb11e57.tar.bz2
2010-05-31 Chris Johns <chrisj@rtems.org>
* libcsupport/Makefile.am: Add mount-mgr.c. * libcsupport/src/mount-mgr.c: New. * include/rtems/fs.h: Added rtems_filesystem_location_mount. * libcsupport/include/rtems/libio.h, libcsupport/src/mount.c: New mount interface. It is similar to Linux. * libcsupport/include/rtems/libio_.h: Remove the init_fs_mount_table call. * libcsupport/src/base_fs.c: Remove init_fs_mount_table_call. Use the new mount call. Remove setting the root node in the global pathloc. Mount does this now. * libcsupport/src/privateenv.c: Remove the hack to set the root mount table entry in the environment. * libcsupport/src/unmount.cL Free the target string. * libblock/src/bdpart-mount.c: New mount API. * libfs/src/devfs/devfs.h, libfs/src/devfs/devfs_init.c, libfs/src/dosfs/dosfs.h, libfs/src/dosfs/msdos.h, libfs/src/dosfs/msdos_init.c, libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_eval.c, libfs/src/imfs/imfs_init.c, libfs/src/imfs/miniimfs_init.c, libfs/src/nfsclient/src/librtemsNfs.h, libfs/src/rfs/rtems-rfs-rtems.c, libfs/src/rfs/rtems-rfs.h, libnetworking/lib/ftpfs.c, libnetworking/rtems/ftpfs.h, libnetworking/rtems/tftp.h: New mount_h API. * libfs/src/devfs/devfs_eval.c: Local include of extern ops. * libfs/src/nfsclient/src/nfs.c: New mount API. Removed the mount me call and fixed the initialisation to happen when mounting. * libmisc/Makefile.am, libmisc/shell/shellconfig.h: Remove mount filesystem files. * libmisc/fsmount/fsmount.c, libmisc/fsmount/fsmount.h: Updated to the new mount table values. * libmisc/shell/main_mount_ftp.c, libmisc/shell/main_mount_msdos.c, libmisc/shell/main_mount_rfs.c, libmisc/shell/main_mount_tftp.c: Removed. * libmisc/shell/main_mount.c: Use the new mount API. Also access the file system table for the file system types. * libnetworking/lib/tftpDriver.c: Updated to the new mount API. Fixed to allow mounting from any mount point. Also can now have more than file system mounted. * sapi/include/confdefs.h: Add file system configuration support.
Diffstat (limited to 'cpukit/libfs/src/imfs')
-rw-r--r--cpukit/libfs/src/imfs/imfs.h6
-rw-r--r--cpukit/libfs/src/imfs/imfs_eval.c74
-rw-r--r--cpukit/libfs/src/imfs/imfs_init.c3
-rw-r--r--cpukit/libfs/src/imfs/miniimfs_init.c3
4 files changed, 45 insertions, 41 deletions
diff --git a/cpukit/libfs/src/imfs/imfs.h b/cpukit/libfs/src/imfs/imfs.h
index 666d35a9a5..33d41e9988 100644
--- a/cpukit/libfs/src/imfs/imfs.h
+++ b/cpukit/libfs/src/imfs/imfs.h
@@ -255,11 +255,13 @@ extern const rtems_filesystem_limits_and_options_t IMFS_LIMITS_AND_OPTIONS;
*/
extern int IMFS_initialize(
- rtems_filesystem_mount_table_entry_t *mt_entry
+ rtems_filesystem_mount_table_entry_t *mt_entry,
+ const void *data
);
extern int miniIMFS_initialize(
- rtems_filesystem_mount_table_entry_t *mt_entry
+ rtems_filesystem_mount_table_entry_t *mt_entry,
+ const void *data
);
extern int IMFS_initialize_support(
diff --git a/cpukit/libfs/src/imfs/imfs_eval.c b/cpukit/libfs/src/imfs/imfs_eval.c
index 7547c6a0e4..b282e7c9a4 100644
--- a/cpukit/libfs/src/imfs/imfs_eval.c
+++ b/cpukit/libfs/src/imfs/imfs_eval.c
@@ -490,7 +490,7 @@ int IMFS_eval_path(
size_t pathnamelen, /* IN */
int flags, /* IN */
rtems_filesystem_location_info_t *pathloc /* IN/OUT */
-)
+ )
{
int i = 0;
int len;
@@ -531,40 +531,40 @@ int IMFS_eval_path(
if ( type != IMFS_NO_MORE_PATH )
if ( node->type == IMFS_DIRECTORY )
if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) )
- rtems_set_errno_and_return_minus_one( EACCES );
+ rtems_set_errno_and_return_minus_one( EACCES );
node = pathloc->node_access;
switch( type ) {
case IMFS_UP_DIR:
- /*
- * Am I at the root of all filesystems? (chroot'ed?)
- */
+ /*
+ * Am I at the root of all filesystems? (chroot'ed?)
+ */
- if ( pathloc->node_access == rtems_filesystem_root.node_access )
- break; /* Throw out the .. in this case */
+ if ( pathloc->node_access == rtems_filesystem_root.node_access )
+ break; /* Throw out the .. in this case */
- /*
- * Am I at the root of this mounted filesystem?
- */
+ /*
+ * Am I at the root of this mounted filesystem?
+ */
if (pathloc->node_access ==
pathloc->mt_entry->mt_fs_root.node_access) {
/*
- * Am I at the root of all filesystems?
- */
+ * Am I at the root of all filesystems?
+ */
if ( pathloc->node_access == rtems_filesystem_root.node_access ) {
break; /* Throw out the .. in this case */
- } else {
+ } else {
newloc = pathloc->mt_entry->mt_point_node;
*pathloc = newloc;
return (*pathloc->ops->evalpath_h)(&(pathname[i-len]),
pathnamelen+len,
flags,pathloc);
- }
- } else {
+ }
+ } else {
if ( !node->Parent )
rtems_set_errno_and_return_minus_one( ENOENT );
@@ -572,17 +572,17 @@ int IMFS_eval_path(
node = node->Parent;
pathloc->node_access = node;
- }
+ }
pathloc->node_access = node;
break;
case IMFS_NAME:
- /*
- * If we are at a link follow it.
- */
+ /*
+ * If we are at a link follow it.
+ */
- if ( node->type == IMFS_HARD_LINK ) {
+ if ( node->type == IMFS_HARD_LINK ) {
IMFS_evaluate_hard_link( pathloc, 0 );
@@ -590,26 +590,26 @@ int IMFS_eval_path(
if ( !node )
rtems_set_errno_and_return_minus_one( ENOTDIR );
- } else if ( node->type == IMFS_SYM_LINK ) {
+ } else if ( node->type == IMFS_SYM_LINK ) {
result = IMFS_evaluate_sym_link( pathloc, 0 );
node = pathloc->node_access;
if ( result == -1 )
return -1;
- }
+ }
- /*
- * Only a directory can be decended into.
- */
+ /*
+ * Only a directory can be decended into.
+ */
- if ( node->type != IMFS_DIRECTORY )
+ if ( node->type != IMFS_DIRECTORY )
rtems_set_errno_and_return_minus_one( ENOTDIR );
- /*
- * If we are at a node that is a mount point. Set loc to the
- * new fs root node and let them finish evaluating the path.
- */
+ /*
+ * If we are at a node that is a mount point. Set loc to the
+ * new fs root node and let them finish evaluating the path.
+ */
if ( node->info.directory.mt_fs != NULL ) {
newloc = node->info.directory.mt_fs->mt_fs_root;
@@ -617,19 +617,19 @@ int IMFS_eval_path(
return (*pathloc->ops->evalpath_h)( &pathname[i-len],
pathnamelen+len,
flags, pathloc );
- }
+ }
- /*
- * Otherwise find the token name in the present location.
- */
+ /*
+ * Otherwise find the token name in the present location.
+ */
node = IMFS_find_match_in_dir( node, token );
if ( !node )
rtems_set_errno_and_return_minus_one( ENOENT );
- /*
- * Set the node access to the point we have found.
- */
+ /*
+ * Set the node access to the point we have found.
+ */
pathloc->node_access = node;
break;
diff --git a/cpukit/libfs/src/imfs/imfs_init.c b/cpukit/libfs/src/imfs/imfs_init.c
index 9dae7cc690..c7e6069d35 100644
--- a/cpukit/libfs/src/imfs/imfs_init.c
+++ b/cpukit/libfs/src/imfs/imfs_init.c
@@ -59,7 +59,8 @@ const rtems_filesystem_operations_table IMFS_ops = {
*/
int IMFS_initialize(
- rtems_filesystem_mount_table_entry_t *temp_mt_entry
+ rtems_filesystem_mount_table_entry_t *temp_mt_entry,
+ const void *data
)
{
return IMFS_initialize_support(
diff --git a/cpukit/libfs/src/imfs/miniimfs_init.c b/cpukit/libfs/src/imfs/miniimfs_init.c
index 2244dfde7d..6bad5e29a2 100644
--- a/cpukit/libfs/src/imfs/miniimfs_init.c
+++ b/cpukit/libfs/src/imfs/miniimfs_init.c
@@ -59,7 +59,8 @@ const rtems_filesystem_operations_table miniIMFS_ops = {
*/
int miniIMFS_initialize(
- rtems_filesystem_mount_table_entry_t *temp_mt_entry
+ rtems_filesystem_mount_table_entry_t *temp_mt_entry,
+ const void *data
)
{
return IMFS_initialize_support(