diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-12-31 10:56:05 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-01-27 06:54:22 +0100 |
commit | cf36b70e8dd8755e7dac6eb516169f586e78566d (patch) | |
tree | 97200818ec5dfeaa4e137a572fcbb4db746842b1 /cpukit/libfs/src/imfs/imfs_load_tar.c | |
parent | user/conf.t: Fix typo (diff) | |
download | rtems-cf36b70e8dd8755e7dac6eb516169f586e78566d.tar.bz2 |
IMFS: Replace node union with individual struct
This reduces the average node size.
Add and use IMFS_GENERIC_INITIALIZER().
Diffstat (limited to 'cpukit/libfs/src/imfs/imfs_load_tar.c')
-rw-r--r-- | cpukit/libfs/src/imfs/imfs_load_tar.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/cpukit/libfs/src/imfs/imfs_load_tar.c b/cpukit/libfs/src/imfs/imfs_load_tar.c index 1ef0e0b6d4..c775a10878 100644 --- a/cpukit/libfs/src/imfs/imfs_load_tar.c +++ b/cpukit/libfs/src/imfs/imfs_load_tar.c @@ -45,7 +45,6 @@ int rtems_tarfs_load( unsigned long file_mode; int offset; unsigned long nblocks; - IMFS_jnode_t *node; int rv = 0; int eval_flags = RTEMS_FS_FOLLOW_LINK; rtems_filesystem_eval_path_context_t ctx; @@ -123,16 +122,20 @@ int rtems_tarfs_load( rtems_filesystem_eval_path_continue( &ctx ); if ( !rtems_filesystem_location_is_null( currentloc ) ) { - node = IMFS_create_node( - currentloc, - IMFS_LINEAR_FILE, - rtems_filesystem_eval_path_get_token( &ctx ), - rtems_filesystem_eval_path_get_tokenlen( &ctx ), - (file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG, - NULL - ); - node->info.linearfile.size = file_size; - node->info.linearfile.direct = &tar_image[offset]; + IMFS_linearfile_t *linfile = (IMFS_linearfile_t *) + IMFS_create_node( + currentloc, + IMFS_LINEAR_FILE, + rtems_filesystem_eval_path_get_token( &ctx ), + rtems_filesystem_eval_path_get_tokenlen( &ctx ), + (file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG, + NULL + ); + + if ( linfile != NULL ) { + linfile->File.size = file_size; + linfile->direct = &tar_image[offset]; + } } nblocks = (((file_size) + 511) & ~511) / 512; |