forked from Imagelibrary/rtems
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:
@@ -980,9 +980,7 @@ static inline void *IMFS_generic_get_context_by_location(
|
|||||||
const rtems_filesystem_location_info_t *loc
|
const rtems_filesystem_location_info_t *loc
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const IMFS_jnode_t *node = (const IMFS_jnode_t *) loc->node_access;
|
return loc->node_access_2;
|
||||||
|
|
||||||
return IMFS_generic_get_context_by_node( node );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void *IMFS_generic_get_context_by_iop(
|
static inline void *IMFS_generic_get_context_by_iop(
|
||||||
|
|||||||
@@ -134,6 +134,8 @@ static rtems_filesystem_eval_path_generic_status IMFS_eval_token(
|
|||||||
--dir->reference_count;
|
--dir->reference_count;
|
||||||
++entry->reference_count;
|
++entry->reference_count;
|
||||||
currentloc->node_access = entry;
|
currentloc->node_access = entry;
|
||||||
|
currentloc->node_access_2 =
|
||||||
|
IMFS_generic_get_context_by_node( entry );
|
||||||
IMFS_Set_handlers( currentloc );
|
IMFS_Set_handlers( currentloc );
|
||||||
|
|
||||||
if ( !terminal ) {
|
if ( !terminal ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user