summaryrefslogtreecommitdiffstats
path: root/c/src/exec/libcsupport/src/mount.c
diff options
context:
space:
mode:
authorJennifer Averett <Jennifer.Averett@OARcorp.com>2000-11-17 18:42:02 +0000
committerJennifer Averett <Jennifer.Averett@OARcorp.com>2000-11-17 18:42:02 +0000
commit4b0d1ab39bad414e8d5ecfb46f66e75387152458 (patch)
treeafa7086fc5539e24b60b860198dc696bf3be4a62 /c/src/exec/libcsupport/src/mount.c
parent2000-11-13 Ralf Corsepius <corsepiu@faw.uni-ulm.de> (diff)
downloadrtems-4b0d1ab39bad414e8d5ecfb46f66e75387152458.tar.bz2
2000-11-17 Jennifer Averret <jennifer@OARcorp.com>
* libc/mount.c (search_mt_for_mount_point): Deleted routine. * libc/mount.c (Is_node_fs_root): Replacement for above that accounts for the imaginary root node being returned by the filesystem evaluation routine. * libc/unmount.c (unmount): Account for imaginary root node being returned and improved variable names to clarify code. * libc/unmount.c (file_systems_below_this_mountpoint): Body of routine replaced to account for imaginary root node being returned.
Diffstat (limited to 'c/src/exec/libcsupport/src/mount.c')
-rw-r--r--c/src/exec/libcsupport/src/mount.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/c/src/exec/libcsupport/src/mount.c b/c/src/exec/libcsupport/src/mount.c
index 11770e1042..6b5471422e 100644
--- a/c/src/exec/libcsupport/src/mount.c
+++ b/c/src/exec/libcsupport/src/mount.c
@@ -35,11 +35,10 @@ Chain_Control rtems_filesystem_mount_table_control;
* Prototypes that probably should be somewhere else.
*/
-int search_mt_for_mount_point(
- rtems_filesystem_location_info_t *location_of_mount_point
-);
-
int init_fs_mount_table( void );
+static int Is_node_fs_root(
+ rtems_filesystem_location_info_t *loc
+);
/*
@@ -140,7 +139,7 @@ int mount(
* You can only mount one file system onto a single mount point.
*/
- if ( search_mt_for_mount_point( &loc ) == FOUND ) {
+ if ( Is_node_fs_root( &loc ) ){
errno = EBUSY;
goto cleanup_and_bail;
}
@@ -232,35 +231,34 @@ int init_fs_mount_table()
return 0;
}
-
/*
- * search_mt_for_mount_point
+ * Is_node_fs_root
*
* This routine will run through the entries that currently exist in the
* mount table chain. For each entry in the mount table chain it will
- * compare the mount tables mt_point_node to the node describing the selected
- * mount point.. If any of the mount table file system mount point nodes
- * match the new file system selected mount point node, we are attempting
- * to mount the new file system onto a node that already has a file system
- * mounted to it. This is not a permitted operation.
+ * compare the mount tables root node to the node describing the selected
+ * mount point. If any match is found true is returned else false is
+ * returned.
+ *
*/
-int search_mt_for_mount_point(
- rtems_filesystem_location_info_t *location_of_mount_point
+static int Is_node_fs_root(
+ rtems_filesystem_location_info_t *loc
)
{
Chain_Node *the_node;
rtems_filesystem_mount_table_entry_t *the_mount_entry;
+ /*
+ * For each mount table entry
+ */
+
for ( the_node = rtems_filesystem_mount_table_control.first;
!Chain_Is_tail( &rtems_filesystem_mount_table_control, the_node );
the_node = the_node->next ) {
-
the_mount_entry = (rtems_filesystem_mount_table_entry_t *) the_node;
- if ( the_mount_entry->mt_point_node.node_access ==
- location_of_mount_point->node_access )
- return FOUND;
+ if ( the_mount_entry->mt_fs_root.node_access == loc->node_access )
+ return TRUE;
}
- return NOT_FOUND;
+ return FALSE;
}
-