diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2010-06-07 15:35:24 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2010-06-07 15:35:24 +0000 |
commit | 7d01d244d7484056f8c0c101eb500fe8cfcfd9bb (patch) | |
tree | 87c02c82f7455420a9322d369477cb5a4565829f /cpukit/libcsupport/include/rtems/libio.h | |
parent | 2010-06-07 Bharath Suri <bharath.s.jois@gmail.com> (diff) | |
download | rtems-7d01d244d7484056f8c0c101eb500fe8cfcfd9bb.tar.bz2 |
2010-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/include/rtems/libio_.h: Declare
rtems_filesystem_mount_table_control.
* libcsupport/include/rtems/libio.h: Removed
rtems_filesystem_table_first(), rtems_filesystem_table_next() and
rtems_filesystem_table_node_t declarations. Declare
rtems_per_filesystem_routine, rtems_filesystem_iterate() and
rtems_filesystem_get_mount_handler().
* libcsupport/src/mount.c: Added rtems_filesystem_mounts_first() and
rtems_filesystem_mounts_next(). Simplify mount(). Removed
rtems_filesystem_mount_table_control_init. Use
rtems_filesystem_get_mount_handler().
* libcsupport/src/mount-mgr.c: Removed rtems_filesystem_mounts_first() and
rtems_filesystem_mounts_next(). Added rtems_filesystem_iterate() and
rtems_filesystem_get_mount_handler(). Use rtems_libio_lock() and
rtems_libio_unlock();
* sapi/include/confdefs.h, libmisc/shell/main_mount.c: Update for
mount API changes.
Diffstat (limited to 'cpukit/libcsupport/include/rtems/libio.h')
-rw-r--r-- | cpukit/libcsupport/include/rtems/libio.h | 49 |
1 files changed, 34 insertions, 15 deletions
diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h index dadc446ead..da9fa884a0 100644 --- a/cpukit/libcsupport/include/rtems/libio.h +++ b/cpukit/libcsupport/include/rtems/libio.h @@ -289,32 +289,51 @@ struct _rtems_filesystem_operations_table { rtems_filesystem_statvfs_t statvfs_h; }; -/* - * File system table used by mount to manage file systems. +/** + * @brief File system table entry. */ typedef struct rtems_filesystem_table_t { const char *type; rtems_filesystem_fsmount_me_t mount_h; } rtems_filesystem_table_t; -/* - * File system table runtime loaded nodes. +/** + * @brief Static table of file systems. + * + * Externally defined by confdefs.h or the user. */ -typedef struct rtems_filesystem_table_node_t { - rtems_chain_node node; - rtems_filesystem_table_t entry; -} rtems_filesystem_table_node_t; +extern const rtems_filesystem_table_t rtems_filesystem_table []; -/* - * Get the first entry in the filesystem table. +/** + * @brief Per file system table entry routine type. + * + * Return @c true to continue the iteration, and @c false to stop. */ -const rtems_filesystem_table_t* rtems_filesystem_table_first( void ); +typedef bool (*rtems_per_filesystem_routine)( + const rtems_filesystem_table_t *entry, + void *arg +); -/* - * Get the next entry in the file system table. +/** + * @brief Iterates over the file system table. + * + * For each file system table entry the @a routine will be called with the + * table entry and the @a routine_arg parameter. */ -const rtems_filesystem_table_t* -rtems_filesystem_table_next( const rtems_filesystem_table_t *entry ); +void +rtems_filesystem_iterate( + rtems_per_filesystem_routine routine, + void *routine_arg +); + +/** + * @brief Returns the file system mount handler associated with the @a type, or + * @c NULL if no such association exists. + */ +rtems_filesystem_fsmount_me_t +rtems_filesystem_get_mount_handler( + const char *type +); /* * Get the first entry in the mount table. |