diff options
Diffstat (limited to 'cpukit/libfs/src/imfs/imfs_make_generic_node.c')
-rw-r--r-- | cpukit/libfs/src/imfs/imfs_make_generic_node.c | 63 |
1 files changed, 28 insertions, 35 deletions
diff --git a/cpukit/libfs/src/imfs/imfs_make_generic_node.c b/cpukit/libfs/src/imfs/imfs_make_generic_node.c index c054a48faa..1daef3e215 100644 --- a/cpukit/libfs/src/imfs/imfs_make_generic_node.c +++ b/cpukit/libfs/src/imfs/imfs_make_generic_node.c @@ -29,10 +29,12 @@ IMFS_jnode_t *IMFS_node_initialize_generic( IMFS_jnode_t *node, - const IMFS_types_union *info + void *arg ) { - node->info.generic.context = info->generic.context; + IMFS_generic_t *generic = (IMFS_generic_t *) node; + + generic->context = arg; return node; } @@ -72,45 +74,36 @@ int IMFS_make_generic_node( } if ( rv == 0 ) { - if ( node_control->imfs_type == IMFS_GENERIC ) { - rtems_filesystem_eval_path_context_t ctx; - int eval_flags = RTEMS_FS_FOLLOW_LINK - | RTEMS_FS_MAKE - | RTEMS_FS_EXCLUSIVE; - const rtems_filesystem_location_info_t *currentloc = - rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); - - if ( IMFS_is_imfs_instance( currentloc ) ) { - IMFS_types_union info; - IMFS_jnode_t *new_node; - - info.generic.context = context; - new_node = IMFS_create_node_with_control( - currentloc, - node_control, - rtems_filesystem_eval_path_get_token( &ctx ), - rtems_filesystem_eval_path_get_tokenlen( &ctx ), - mode, - &info - ); - - if ( new_node != NULL ) { - IMFS_jnode_t *parent = currentloc->node_access; - - IMFS_mtime_ctime_update( parent ); - } else { - rv = -1; - } + rtems_filesystem_eval_path_context_t ctx; + int eval_flags = RTEMS_FS_FOLLOW_LINK + | RTEMS_FS_MAKE + | RTEMS_FS_EXCLUSIVE; + const rtems_filesystem_location_info_t *currentloc = + rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); + + if ( IMFS_is_imfs_instance( currentloc ) ) { + IMFS_jnode_t *new_node = IMFS_create_node_with_control( + currentloc, + node_control, + rtems_filesystem_eval_path_get_token( &ctx ), + rtems_filesystem_eval_path_get_tokenlen( &ctx ), + mode, + context + ); + + if ( new_node != NULL ) { + IMFS_jnode_t *parent = currentloc->node_access; + + IMFS_mtime_ctime_update( parent ); } else { - rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); rv = -1; } - - rtems_filesystem_eval_path_cleanup( &ctx ); } else { - errno = EINVAL; + rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); rv = -1; } + + rtems_filesystem_eval_path_cleanup( &ctx ); } return rv; |