diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-01-19 19:31:00 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-01-19 19:31:00 +0000 |
commit | cb4e99201e1702a62af73debe342ea289f0d8362 (patch) | |
tree | 59ce92a3f4280b556c1456896b77a3ea3e57dbab /cpukit/libfs/src/imfs/imfs_initsupp.c | |
parent | Update of libblock API, update of tqm8xx BSP (diff) | |
download | rtems-cb4e99201e1702a62af73debe342ea289f0d8362.tar.bz2 |
2010-01-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_creat.c,
libfs/src/imfs/imfs_initsupp.c, libfs/src/imfs/imfs_link.c,
libfs/src/imfs/imfs_load_tar.c, libfs/src/imfs/imfs_mknod.c,
libfs/src/imfs/imfs_symlink.c: Create special helper method for
creating the j-node for the root directory. This lets us assume that
every j-node created otherwise has a parent node.
Diffstat (limited to 'cpukit/libfs/src/imfs/imfs_initsupp.c')
-rw-r--r-- | cpukit/libfs/src/imfs/imfs_initsupp.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/cpukit/libfs/src/imfs/imfs_initsupp.c b/cpukit/libfs/src/imfs/imfs_initsupp.c index 648150257b..510915e922 100644 --- a/cpukit/libfs/src/imfs/imfs_initsupp.c +++ b/cpukit/libfs/src/imfs/imfs_initsupp.c @@ -1,7 +1,7 @@ /* * IMFS Initialization * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2010. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -43,12 +43,11 @@ static int IMFS_determine_bytes_per_block( { bool is_valid = false; int bit_mask; + /* * check, whether requested bytes per block is valid */ - for (bit_mask = 16; - !is_valid && (bit_mask <= 512); - bit_mask <<= 1) { + for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { if (bit_mask == requested_bytes_per_block) { is_valid = true; } @@ -57,14 +56,12 @@ static int IMFS_determine_bytes_per_block( ? requested_bytes_per_block : default_bytes_per_block); return 0; - } /* * IMFS_initialize */ - int IMFS_initialize_support( rtems_filesystem_mount_table_entry_t *temp_mt_entry, const rtems_filesystem_operations_table *op_table, @@ -87,15 +84,7 @@ int IMFS_initialize_support( * * NOTE: UNIX root is 755 and owned by root/root (0/0). */ - - temp_mt_entry->mt_fs_root.node_access = IMFS_create_node( - NULL, - IMFS_DIRECTORY, - "", - ( S_IFDIR | 0755 ), - NULL - ); - + temp_mt_entry->mt_fs_root.node_access = IMFS_create_root_node(); temp_mt_entry->mt_fs_root.handlers = directory_handlers; temp_mt_entry->mt_fs_root.ops = op_table; temp_mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS; @@ -104,7 +93,7 @@ int IMFS_initialize_support( * Create custom file system data. */ fs_info = calloc( 1, sizeof( IMFS_fs_info_t ) ); - if ( !fs_info ){ + if ( !fs_info ) { free(temp_mt_entry->mt_fs_root.node_access); rtems_set_errno_and_return_minus_one(ENOMEM); } |