summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/imfs/imfs_handlers_memfile.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-02-24 17:08:06 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-03-13 12:24:16 +0100
commit699ac7c08f8e0f7f1a37144e9c316c0dd7a16175 (patch)
treef07bb6097b312586f45c0803c8d4a8464f8068a1 /cpukit/libfs/src/imfs/imfs_handlers_memfile.c
parentIMFS: New support functions (diff)
downloadrtems-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 '')
-rw-r--r--cpukit/libfs/src/imfs/imfs_handlers_memfile.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/cpukit/libfs/src/imfs/imfs_handlers_memfile.c b/cpukit/libfs/src/imfs/imfs_handlers_memfile.c
index 10cba9477b..0e32291533 100644
--- a/cpukit/libfs/src/imfs/imfs_handlers_memfile.c
+++ b/cpukit/libfs/src/imfs/imfs_handlers_memfile.c
@@ -17,11 +17,7 @@
#include "imfs.h"
-/*
- * Set of operations handlers for operations on memfile entities.
- */
-
-const rtems_filesystem_file_handlers_r IMFS_memfile_handlers = {
+static const rtems_filesystem_file_handlers_r IMFS_memfile_handlers = {
memfile_open,
rtems_filesystem_default_close,
memfile_read,
@@ -34,3 +30,19 @@ const rtems_filesystem_file_handlers_r IMFS_memfile_handlers = {
rtems_filesystem_default_fsync_or_fdatasync_success,
rtems_filesystem_default_fcntl
};
+
+const IMFS_node_control IMFS_node_control_memfile = {
+ .imfs_type = IMFS_MEMORY_FILE,
+ .handlers = &IMFS_memfile_handlers,
+ .node_initialize = IMFS_node_initialize_default,
+ .node_remove = IMFS_node_remove_default,
+ .node_destroy = IMFS_memfile_remove
+};
+
+const IMFS_node_control IMFS_node_control_linfile = {
+ .imfs_type = IMFS_LINEAR_FILE,
+ .handlers = &IMFS_memfile_handlers,
+ .node_initialize = IMFS_node_initialize_default,
+ .node_remove = IMFS_node_remove_default,
+ .node_destroy = IMFS_node_destroy_default
+};