From 699ac7c08f8e0f7f1a37144e9c316c0dd7a16175 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 24 Feb 2012 17:08:06 +0100 Subject: 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. --- cpukit/libfs/src/imfs/imfs_fifo.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'cpukit/libfs/src/imfs/imfs_fifo.c') diff --git a/cpukit/libfs/src/imfs/imfs_fifo.c b/cpukit/libfs/src/imfs/imfs_fifo.c index dc623629b6..616025669a 100644 --- a/cpukit/libfs/src/imfs/imfs_fifo.c +++ b/cpukit/libfs/src/imfs/imfs_fifo.c @@ -119,11 +119,7 @@ static off_t IMFS_fifo_lseek( IMFS_FIFO_RETURN(err); } -/* - * Handler table for IMFS FIFO nodes - */ - -const rtems_filesystem_file_handlers_r IMFS_fifo_handlers = { +static const rtems_filesystem_file_handlers_r IMFS_fifo_handlers = { IMFS_fifo_open, IMFS_fifo_close, IMFS_fifo_read, @@ -136,3 +132,11 @@ const rtems_filesystem_file_handlers_r IMFS_fifo_handlers = { rtems_filesystem_default_fsync_or_fdatasync, rtems_filesystem_default_fcntl }; + +const IMFS_node_control IMFS_node_control_fifo = { + .imfs_type = IMFS_FIFO, + .handlers = &IMFS_fifo_handlers, + .node_initialize = IMFS_node_initialize_default, + .node_remove = IMFS_node_remove_default, + .node_destroy = IMFS_node_destroy_default +}; -- cgit v1.2.3