summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/mount-mgr.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2010-07-01 13:05:18 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2010-07-01 13:05:18 +0000
commit6c0fcd4a39795f11f8d2b8caa2b69d0bd27a2c03 (patch)
tree4d22f3352e6456c69f45d9536732e4a1b6832c34 /cpukit/libcsupport/src/mount-mgr.c
parent2010-07-01 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff)
downloadrtems-6c0fcd4a39795f11f8d2b8caa2b69d0bd27a2c03.tar.bz2
2010-07-01 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/include/rtems/libio_.h: Removed rtems_filesystem_mount_table_control. * libcsupport/include/rtems/libio.h, libcsupport/src/mount-mgr.c, libcsupport/src/mount.c libcsupport/src/statvfs.c, libcsupport/src/unmount.c, libmisc/shell/main_mount.c: Documentation. Removed rtems_filesystem_mounts_first() and rtems_filesystem_mounts_next(). Added rtems_filesystem_mount_iterate(). Changed return type of rtems_filesystem_iterate(). Removed rtems_filesystem_nodes_equal().
Diffstat (limited to 'cpukit/libcsupport/src/mount-mgr.c')
-rw-r--r--cpukit/libcsupport/src/mount-mgr.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/cpukit/libcsupport/src/mount-mgr.c b/cpukit/libcsupport/src/mount-mgr.c
index 03ead45c9b..e2523978bb 100644
--- a/cpukit/libcsupport/src/mount-mgr.c
+++ b/cpukit/libcsupport/src/mount-mgr.c
@@ -37,38 +37,37 @@ typedef struct {
rtems_filesystem_table_t entry;
} filesystem_node;
-RTEMS_CHAIN_DEFINE_EMPTY(filesystem_chain);
+static RTEMS_CHAIN_DEFINE_EMPTY(filesystem_chain);
-void
-rtems_filesystem_iterate(
+bool rtems_filesystem_iterate(
rtems_per_filesystem_routine routine,
void *routine_arg
)
{
const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0];
rtems_chain_node *node = NULL;
+ bool stop = false;
- while ( table_entry->type ) {
- if ( !(*routine)( table_entry, routine_arg ) ) {
- break;
- }
-
+ while ( table_entry->type && !stop ) {
+ stop = (*routine)( table_entry, routine_arg );
++table_entry;
}
- rtems_libio_lock();
- for (
- node = rtems_chain_first( &filesystem_chain );
- !rtems_chain_is_tail( &filesystem_chain, node );
- node = rtems_chain_next( node )
- ) {
- const filesystem_node *fsn = (filesystem_node *) node;
+ if ( !stop ) {
+ rtems_libio_lock();
+ for (
+ node = rtems_chain_first( &filesystem_chain );
+ !rtems_chain_is_tail( &filesystem_chain, node ) && !stop;
+ node = rtems_chain_next( node )
+ ) {
+ const filesystem_node *fsn = (filesystem_node *) node;
- if ( !(*routine)( &fsn->entry, routine_arg ) ) {
- break;
+ stop = (*routine)( &fsn->entry, routine_arg );
}
+ rtems_libio_unlock();
}
- rtems_libio_unlock();
+
+ return stop;
}
typedef struct {
@@ -81,7 +80,7 @@ static bool find_handler(const rtems_filesystem_table_t *entry, void *arg)
find_arg *fa = arg;
if ( strcmp( entry->type, fa->type ) != 0 ) {
- return true;
+ return false;
} else {
fa->mount_h = entry->mount_h;