diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-02-24 17:08:06 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-03-13 12:24:16 +0100 |
commit | 699ac7c08f8e0f7f1a37144e9c316c0dd7a16175 (patch) | |
tree | f07bb6097b312586f45c0803c8d4a8464f8068a1 /cpukit/libfs/src/imfs/miniimfs_init.c | |
parent | IMFS: New support functions (diff) | |
download | rtems-699ac7c08f8e0f7f1a37144e9c316c0dd7a16175.tar.bz2 |
IMFS: Add and use node control
Add and use structure IMFS_node_control with support functions. This
helps to make high level functions independent of the node type and
reduces the number of branches in the code.
Diffstat (limited to 'cpukit/libfs/src/imfs/miniimfs_init.c')
-rw-r--r-- | cpukit/libfs/src/imfs/miniimfs_init.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/cpukit/libfs/src/imfs/miniimfs_init.c b/cpukit/libfs/src/imfs/miniimfs_init.c index af791f5a31..d70f4db6ce 100644 --- a/cpukit/libfs/src/imfs/miniimfs_init.c +++ b/cpukit/libfs/src/imfs/miniimfs_init.c @@ -23,7 +23,7 @@ #include "imfs.h" -static const rtems_filesystem_operations_table miniIMFS_ops = { +const rtems_filesystem_operations_table miniIMFS_ops = { .lock_h = rtems_filesystem_default_lock, .unlock_h = rtems_filesystem_default_unlock, .eval_path_h = IMFS_eval_path, @@ -47,6 +47,17 @@ static const rtems_filesystem_operations_table miniIMFS_ops = { .statvfs_h = rtems_filesystem_default_statvfs }; +static const IMFS_node_control *const + IMFS_mini_node_controls [IMFS_TYPE_COUNT] = { + [IMFS_DIRECTORY] = &IMFS_node_control_directory, + [IMFS_DEVICE] = &IMFS_node_control_device, + [IMFS_HARD_LINK] = &IMFS_node_control_default, + [IMFS_SYM_LINK] = &IMFS_node_control_default, + [IMFS_MEMORY_FILE] = &IMFS_node_control_memfile, + [IMFS_LINEAR_FILE] = &IMFS_node_control_linfile, + [IMFS_FIFO] = &IMFS_node_control_default +}; + int miniIMFS_initialize( rtems_filesystem_mount_table_entry_t *mt_entry, const void *data @@ -55,7 +66,6 @@ int miniIMFS_initialize( return IMFS_initialize_support( mt_entry, &miniIMFS_ops, - &rtems_filesystem_handlers_default, /* for links */ - &rtems_filesystem_handlers_default /* for fifos */ + IMFS_mini_node_controls ); } |