IMFS: Improved support for generic nodes

The rtems_filesystem_location_info_t::node_access_2 was unused by the
IMFS.  Use it to hold the context of generic nodes.  This makes it
possible to use node handlers for objects with and without a
corresponding file system node.

For example network sockets created with socket() have only a file
descriptor, but no corresponding file system node.  The UNIX(4) domain
sockets can be bound to file system nodes.  In both cases the
rtems_filesystem_location_info_t must provide a pointer to the socket
structure used by the socket node handlers.  With the context pointer
(for sockets, this is the socket structure) in
rtems_filesystem_location_info_t::node_access_2 the same node handlers
can be used in both cases.
This commit is contained in:
Sebastian Huber
2014-01-16 13:05:13 +01:00
parent 45e82bb862
commit 5b34e7ada4
2 changed files with 3 additions and 3 deletions

View File

@@ -980,9 +980,7 @@ static inline void *IMFS_generic_get_context_by_location(
const rtems_filesystem_location_info_t *loc
)
{
const IMFS_jnode_t *node = (const IMFS_jnode_t *) loc->node_access;
return IMFS_generic_get_context_by_node( node );
return loc->node_access_2;
}
static inline void *IMFS_generic_get_context_by_iop(

View File

@@ -134,6 +134,8 @@ static rtems_filesystem_eval_path_generic_status IMFS_eval_token(
--dir->reference_count;
++entry->reference_count;
currentloc->node_access = entry;
currentloc->node_access_2 =
IMFS_generic_get_context_by_node( entry );
IMFS_Set_handlers( currentloc );
if ( !terminal ) {