Changeset d71fcab in rtems
- Timestamp:
- 10/12/99 18:44:40 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 578a415
- Parents:
- cb5056b3
- Files:
-
- 46 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/libcsupport/src/chdir.c
rcb5056b3 rd71fcab 39 39 */ 40 40 41 if ( !loc.ops->node_type ) 41 if ( !loc.ops->node_type ) { 42 if ( loc.ops->freenod ) 43 (*loc.ops->freenod)( &loc ); 42 44 set_errno_and_return_minus_one( ENOTSUP ); 45 } 43 46 44 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) 47 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 48 if ( loc.ops->freenod ) 49 (*loc.ops->freenod)( &loc ); 45 50 set_errno_and_return_minus_one( ENOTDIR ); 46 51 } 52 53 if ( rtems_filesystem_current.ops->freenod ) 54 (*rtems_filesystem_current.ops->freenod)( &rtems_filesystem_current ); 55 47 56 rtems_filesystem_current = loc; 48 57 -
c/src/exec/libcsupport/src/chmod.c
rcb5056b3 rd71fcab 29 29 int status; 30 30 rtems_filesystem_location_info_t loc; 31 int result; 31 32 32 33 status = rtems_filesystem_evaluate_path( path, 0, &loc, TRUE ); … … 34 35 return -1; 35 36 36 if ( !loc.handlers->fchmod ) 37 if ( !loc.handlers->fchmod ){ 38 if ( loc.ops->freenod ) 39 (*loc.ops->freenod)( &loc ); 37 40 set_errno_and_return_minus_one( ENOTSUP ); 41 } 38 42 39 return (*loc.handlers->fchmod)( &loc, mode ); 43 result = (*loc.handlers->fchmod)( &loc, mode ); 44 45 if ( loc.ops->freenod ) 46 (*loc.ops->freenod)( &loc ); 47 48 return result; 40 49 } -
c/src/exec/libcsupport/src/chown.c
rcb5056b3 rd71fcab 27 27 ) 28 28 { 29 rtems_filesystem_location_info_t temp_loc; 29 rtems_filesystem_location_info_t loc; 30 int result; 30 31 31 if ( rtems_filesystem_evaluate_path( path, 0x00, & temp_loc, TRUE ) )32 if ( rtems_filesystem_evaluate_path( path, 0x00, &loc, TRUE ) ) 32 33 return -1; 33 34 34 if ( !temp_loc.ops->chown ) 35 if ( !loc.ops->chown ) { 36 if ( loc.ops->freenod ) 37 (*loc.ops->freenod)( &loc ); 35 38 set_errno_and_return_minus_one( ENOTSUP ); 39 } 36 40 37 return (*temp_loc.ops->chown)( &temp_loc, owner, group ); 41 result = (*loc.ops->chown)( &loc, owner, group ); 42 43 if ( loc.ops->freenod ) 44 (*loc.ops->freenod)( &loc ); 45 46 return result; 38 47 } -
c/src/exec/libcsupport/src/link.c
rcb5056b3 rd71fcab 33 33 * Get the node we are linking to. 34 34 */ 35 35 36 result = rtems_filesystem_evaluate_path( existing, 0, &existing_loc, TRUE ); 36 37 if ( result != 0 ) … … 43 44 rtems_filesystem_get_start_loc( new, &i, &parent_loc ); 44 45 result = (*parent_loc.ops->evalformake)( &new[i], &parent_loc, &name_start ); 45 if ( result != 0 ) 46 set_errno_and_return_minus_one( result ); 46 if ( result != 0 ) { 47 if ( existing_loc.ops->freenod ) 48 (*existing_loc.ops->freenod)( &parent_loc ); 49 set_errno_and_return_minus_one( result ); 50 } 47 51 48 52 /* … … 51 55 */ 52 56 53 if ( parent_loc.mt_entry != existing_loc.mt_entry ) 57 if ( parent_loc.mt_entry != existing_loc.mt_entry ) { 58 if ( existing_loc.ops->freenod ) 59 (*existing_loc.ops->freenod)( &existing_loc ); 60 61 if ( parent_loc.ops->freenod ) 62 (*parent_loc.ops->freenod)( &parent_loc ); 63 54 64 set_errno_and_return_minus_one( EXDEV ); 65 } 55 66 56 if ( !parent_loc.ops->link ) 67 if ( !parent_loc.ops->link ) { 68 69 if ( existing_loc.ops->freenod ) 70 (*existing_loc.ops->freenod)( &existing_loc ); 71 72 if ( parent_loc.ops->freenod ) 73 (*parent_loc.ops->freenod)( &parent_loc ); 74 57 75 set_errno_and_return_minus_one( ENOTSUP ); 76 } 58 77 59 return (*parent_loc.ops->link)( &existing_loc, &parent_loc, name_start ); 78 result = (*parent_loc.ops->link)( &existing_loc, &parent_loc, name_start ); 79 80 if ( existing_loc.ops->freenod ) 81 (*existing_loc.ops->freenod)( &existing_loc ); 82 83 if ( parent_loc.ops->freenod ) 84 (*parent_loc.ops->freenod)( &parent_loc ); 85 86 return result; 60 87 } 61 88 -
c/src/exec/libcsupport/src/mknod.c
rcb5056b3 rd71fcab 53 53 return -1; 54 54 55 if ( !temp_loc.ops->mknod ) 55 if ( !temp_loc.ops->mknod ) { 56 if ( temp_loc.ops->freenod ) 57 (*temp_loc.ops->freenod)( &temp_loc ); 56 58 set_errno_and_return_minus_one( ENOTSUP ); 59 } 57 60 58 return (*temp_loc.ops->mknod)( name_start, mode, dev, &temp_loc ); 61 result = (*temp_loc.ops->mknod)( name_start, mode, dev, &temp_loc ); 62 if ( temp_loc.ops->freenod ) 63 (*temp_loc.ops->freenod)( &temp_loc ); 64 65 return result; 59 66 } -
c/src/exec/libcsupport/src/mount.c
rcb5056b3 rd71fcab 89 89 rtems_filesystem_mount_table_entry_t **mt_entry, 90 90 rtems_filesystem_operations_table *fs_ops, 91 rtems_filesystem_options_t fsoptions,91 rtems_filesystem_options_t options, 92 92 char *device, 93 93 char *mount_point 94 94 ) 95 95 { 96 rtems_filesystem_location_info_t temp_loc; 97 rtems_filesystem_options_t options; 96 rtems_filesystem_location_info_t loc; 98 97 rtems_filesystem_mount_table_entry_t *temp_mt_entry; 99 98 … … 113 112 */ 114 113 115 if ( fsoptions != RTEMS_FILESYSTEM_READ_ONLY &&116 fsoptions != RTEMS_FILESYSTEM_READ_WRITE ) {114 if ( options != RTEMS_FILESYSTEM_READ_ONLY && 115 options != RTEMS_FILESYSTEM_READ_WRITE ) { 117 116 errno = EINVAL; 118 117 return -1; … … 146 145 mount_point, 147 146 RTEMS_LIBIO_PERMS_RWX, 148 & temp_loc,147 &loc, 149 148 TRUE ) == -1 ) 150 149 goto cleanup_and_bail; … … 154 153 */ 155 154 156 if ( temp_loc.ops->node_type( &temp_loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {155 if ( loc.ops->node_type( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 157 156 errno = ENOTDIR; 158 157 goto cleanup_and_bail; … … 163 162 */ 164 163 165 if ( search_mt_for_mount_point( & temp_loc ) == FOUND ) {164 if ( search_mt_for_mount_point( &loc ) == FOUND ) { 166 165 errno = EBUSY; 167 166 goto cleanup_and_bail; … … 173 172 */ 174 173 175 temp_mt_entry->mt_point_node.node_access = temp_loc.node_access;176 temp_mt_entry->mt_point_node.handlers = temp_loc.handlers;177 temp_mt_entry->mt_point_node.ops = temp_loc.ops;178 temp_mt_entry->mt_point_node.mt_entry = temp_loc.mt_entry;174 temp_mt_entry->mt_point_node.node_access = loc.node_access; 175 temp_mt_entry->mt_point_node.handlers = loc.handlers; 176 temp_mt_entry->mt_point_node.ops = loc.ops; 177 temp_mt_entry->mt_point_node.mt_entry = loc.mt_entry; 179 178 180 179 /* … … 183 182 */ 184 183 185 if ( ! temp_loc.ops->mount ){184 if ( !loc.ops->mount ){ 186 185 errno = ENOTSUP; 187 186 goto cleanup_and_bail; 188 187 } 189 188 190 if ( temp_loc.ops->mount( temp_mt_entry ) ) {189 if ( loc.ops->mount( temp_mt_entry ) ) { 191 190 goto cleanup_and_bail; 192 191 } … … 225 224 226 225 *mt_entry = temp_mt_entry; 226 227 if ( loc.ops->freenod ) 228 (*loc.ops->freenod)( &loc ); 229 227 230 return 0; 228 231 … … 230 233 231 234 free( temp_mt_entry ); 235 236 if ( loc.ops->freenod ) 237 (*loc.ops->freenod)( &loc ); 238 232 239 return -1; 233 240 } -
c/src/exec/libcsupport/src/open.c
rcb5056b3 rd71fcab 63 63 rtems_libio_t *iop = 0; 64 64 int status; 65 rtems_filesystem_location_info_t temp_loc;65 rtems_filesystem_location_info_t loc; 66 66 int eval_flags; 67 67 … … 105 105 106 106 status = rtems_filesystem_evaluate_path( 107 pathname, eval_flags, & temp_loc, TRUE );107 pathname, eval_flags, &loc, TRUE ); 108 108 109 109 if ( status == -1 ) { … … 127 127 128 128 /* Sanity check to see if the file name exists after the mknod() */ 129 status = rtems_filesystem_evaluate_path( pathname, 0x0, & temp_loc, TRUE );129 status = rtems_filesystem_evaluate_path( pathname, 0x0, &loc, TRUE ); 130 130 if ( status != 0 ) { /* The file did not exist */ 131 131 rc = EACCES; … … 140 140 141 141 /* 142 * Fill in the file control block based on the temp_loc structure142 * Fill in the file control block based on the loc structure 143 143 * returned by successful path evaluation. 144 144 */ 145 145 146 146 iop->offset = 0; 147 iop->handlers = temp_loc.handlers;148 iop->file_info = temp_loc.node_access;147 iop->handlers = loc.handlers; 148 iop->file_info = loc.node_access; 149 149 iop->flags |= rtems_libio_fcntl_flags( flags ); 150 iop->pathinfo = temp_loc;150 iop->pathinfo = loc; 151 151 152 152 if ( !iop->handlers->open ) { … … 179 179 set_errno_and_return_minus_one( rc ); 180 180 } 181 182 if ( loc.ops->freenod ) 183 (*loc.ops->freenod)( &loc ); 184 181 185 return iop - rtems_libio_iops; 182 186 } -
c/src/exec/libcsupport/src/readlink.c
rcb5056b3 rd71fcab 24 24 int result; 25 25 26 if (!buf) 27 set_errno_and_return_minus_one( EFAULT ); 28 26 29 result = rtems_filesystem_evaluate_path( pathname, 0, &loc, FALSE ); 27 30 if ( result != 0 ) 28 31 return -1; 29 32 30 if (!buf) 31 set_errno_and_return_minus_one( EFAULT ); 33 if ( !loc.ops->node_type ){ 34 if ( loc.ops->freenod ) 35 (*loc.ops->freenod)( &loc ); 36 set_errno_and_return_minus_one( ENOTSUP ); 37 } 32 38 33 if ( !loc.ops->node_type ) 39 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){ 40 if ( loc.ops->freenod ) 41 (*loc.ops->freenod)( &loc ); 42 set_errno_and_return_minus_one( EINVAL ); 43 } 44 45 if ( !loc.ops->readlink ){ 46 if ( loc.ops->freenod ) 47 (*loc.ops->freenod)( &loc ); 34 48 set_errno_and_return_minus_one( ENOTSUP ); 49 } 35 50 36 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ) 37 set_errno_and_return_minus_one( EINVAL ); 51 result = (*loc.ops->readlink)( &loc, buf, bufsize ); 38 52 39 if ( !loc.ops->readlink)40 set_errno_and_return_minus_one( ENOTSUP);41 42 return (*loc.ops->readlink)( &loc, buf, bufsize );53 if ( loc.ops->freenod ) 54 (*loc.ops->freenod)( &loc ); 55 56 return result; 43 57 } -
c/src/exec/libcsupport/src/rmdir.c
rcb5056b3 rd71fcab 40 40 */ 41 41 42 if ( !loc.ops->node_type ) 42 if ( !loc.ops->node_type ){ 43 if ( loc.ops->freenod ) 44 (*loc.ops->freenod)( &loc ); 43 45 set_errno_and_return_minus_one( ENOTSUP ); 46 } 44 47 45 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) 48 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ){ 49 if ( loc.ops->freenod ) 50 (*loc.ops->freenod)( &loc ); 46 51 set_errno_and_return_minus_one( ENOTDIR ); 52 } 47 53 48 54 /* … … 50 56 */ 51 57 52 if ( !loc.ops->rmnod ) 58 if ( !loc.ops->rmnod ){ 59 if ( loc.ops->freenod ) 60 (*loc.ops->freenod)( &loc ); 53 61 set_errno_and_return_minus_one( ENOTSUP ); 62 } 54 63 55 return (*loc.ops->rmnod)( &loc ); 64 result = (*loc.ops->rmnod)( &loc ); 65 66 if ( loc.ops->freenod ) 67 (*loc.ops->freenod)( &loc ); 68 69 return result; 56 70 } -
c/src/exec/libcsupport/src/stat.c
rcb5056b3 rd71fcab 59 59 return -1; 60 60 61 if ( !loc.handlers->fstat ) 61 if ( !loc.handlers->fstat ){ 62 if ( loc.ops->freenod ) 63 (*loc.ops->freenod)( &loc ); 62 64 set_errno_and_return_minus_one( ENOTSUP ); 65 } 63 66 64 67 /* … … 69 72 memset( buf, 0, sizeof(struct stat) ); 70 73 71 return (*loc.handlers->fstat)( &loc, buf ); 74 status = (*loc.handlers->fstat)( &loc, buf ); 75 76 if ( loc.ops->freenod ) 77 (*loc.ops->freenod)( &loc ); 78 79 return status; 72 80 } 73 81 #endif -
c/src/exec/libcsupport/src/symlink.c
rcb5056b3 rd71fcab 30 30 return -1; 31 31 32 return (*loc.ops->symlink)( &loc, actualpath, name_start); 32 result = (*loc.ops->symlink)( &loc, actualpath, name_start); 33 34 if ( loc.ops->freenod ) 35 (*loc.ops->freenod)( &loc ); 36 37 return result; 33 38 } 34 39 -
c/src/exec/libcsupport/src/unlink.c
rcb5056b3 rd71fcab 32 32 return -1; 33 33 34 if ( !loc.ops->node_type ) 34 if ( !loc.ops->node_type ) { 35 if ( loc.ops->freenod ) 36 (*loc.ops->freenod)( &loc ); 35 37 set_errno_and_return_minus_one( ENOTSUP ); 38 } 36 39 37 if ( (*loc.ops->node_type)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) 40 if ( (*loc.ops->node_type)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) { 41 if ( loc.ops->freenod ) 42 (*loc.ops->freenod)( &loc ); 38 43 set_errno_and_return_minus_one( EISDIR ); 44 } 45 46 if ( !loc.ops->unlink ) { 47 if ( loc.ops->freenod ) 48 (*loc.ops->freenod)( &loc ); 49 set_errno_and_return_minus_one( ENOTSUP ); 50 } 51 52 result = (*loc.ops->unlink)( &loc ); 53 54 if ( loc.ops->freenod ) 55 (*loc.ops->freenod)( &loc ); 39 56 40 if ( !loc.ops->unlink ) 41 set_errno_and_return_minus_one( ENOTSUP ); 42 43 return (*loc.ops->unlink)( &loc ); 57 return result; 44 58 } 45 59 -
c/src/exec/libcsupport/src/unmount.c
rcb5056b3 rd71fcab 84 84 */ 85 85 86 if ( rtems_filesystem_current.mt_entry == temp_loc.mt_entry ) 86 if ( rtems_filesystem_current.mt_entry == temp_loc.mt_entry ) { 87 if ( temp_loc.ops->freenod ) 88 (*temp_loc.ops->freenod)( &temp_loc ); 87 89 set_errno_and_return_minus_one( EBUSY ); 90 } 88 91 89 92 /* … … 93 96 */ 94 97 95 if ( rtems_libio_is_open_files_in_fs( temp_loc.mt_entry ) == 1 ) 98 if ( rtems_libio_is_open_files_in_fs( temp_loc.mt_entry ) == 1 ) { 99 if ( temp_loc.ops->freenod ) 100 (*temp_loc.ops->freenod)( &temp_loc ); 96 101 set_errno_and_return_minus_one( EBUSY ); 102 } 97 103 98 104 /* … … 104 110 */ 105 111 106 if ( ( temp_mt_entry.mt_point_node.ops->unmount )( temp_loc.mt_entry ) != 0 ) 112 if ((temp_mt_entry.mt_point_node.ops->unmount )( temp_loc.mt_entry ) != 0 ) { 113 if ( temp_loc.ops->freenod ) 114 (*temp_loc.ops->freenod)( &temp_loc ); 115 return -1; 116 } 117 118 /* 119 * Run the unmount function for the subordinate file system. 120 */ 121 122 if ((temp_mt_entry.mt_fs_root.ops->fsunmount_me )( temp_loc.mt_entry ) != 0){ 123 if ( temp_loc.ops->freenod ) 124 (*temp_loc.ops->freenod)( &temp_loc ); 107 125 return -1; 108 109 /* 110 * Run the unmount function for the subordinate file system. 111 */ 112 113 if ( ( temp_mt_entry.mt_fs_root.ops->fsunmount_me )( temp_loc.mt_entry ) != 0 ) 114 return -1; 126 } 115 127 116 128 /* … … 131 143 132 144 free( temp_loc.mt_entry ); 145 if ( temp_loc.ops->freenod ) 146 (*temp_loc.ops->freenod)( &temp_loc ); 133 147 134 148 return result; -
c/src/exec/libcsupport/src/utime.c
rcb5056b3 rd71fcab 25 25 { 26 26 rtems_filesystem_location_info_t temp_loc; 27 int result; 28 29 if ( !temp_loc.ops->utime ) 30 set_errno_and_return_minus_one( ENOTSUP ); 27 31 28 32 if ( rtems_filesystem_evaluate_path( path, 0x00, &temp_loc, TRUE ) ) 29 33 return -1; 30 34 31 if ( !temp_loc.ops->utime ) 32 set_errno_and_return_minus_one( ENOTSUP ); 35 result = (*temp_loc.ops->utime)( &temp_loc, times->actime, times->modtime ); 33 36 34 return (*temp_loc.ops->utime)( &temp_loc, times->actime, times->modtime ); 37 if ( temp_loc.ops->freenod ) 38 (*temp_loc.ops->freenod)( &temp_loc ); 39 40 return result; 35 41 } -
c/src/exec/libfs/src/imfs/ioman.c
rcb5056b3 rd71fcab 62 62 * 63 63 * This version is not reentrant. 64 * 65 * XXX - This is dependent upon IMFS and should not be. 66 * Suggest adding a filesystem routine to fill in the device_info. 64 67 */ 65 68 … … 71 74 #if !defined(RTEMS_UNIX) 72 75 IMFS_jnode_t *the_jnode; 73 rtems_filesystem_location_info_t temp_loc;76 rtems_filesystem_location_info_t loc; 74 77 static rtems_driver_name_t device; 75 78 int result; 79 rtems_filesystem_node_types_t node_type; 76 80 77 result = rtems_filesystem_evaluate_path( name, 0x00, & temp_loc, TRUE );78 the_jnode = temp_loc.node_access;81 result = rtems_filesystem_evaluate_path( name, 0x00, &loc, TRUE ); 82 the_jnode = loc.node_access; 79 83 80 if ( (result != 0) || the_jnode->type != IMFS_DEVICE ) { 84 node_type = (*loc.ops->node_type)( &loc ); 85 86 if ( (result != 0) || node_type != RTEMS_FILESYSTEM_DEVICE ) { 81 87 *device_info = 0; 88 if ( loc.ops->freenod ) 89 (*loc.ops->freenod)( &loc ); 82 90 return RTEMS_UNSATISFIED; 83 91 } … … 88 96 device.minor = the_jnode->info.device.minor; 89 97 *device_info = &device; 98 99 if ( loc.ops->freenod ) 100 (*loc.ops->freenod)( &loc ); 101 90 102 #endif 91 103 return RTEMS_SUCCESSFUL; -
c/src/lib/libc/chdir.c
rcb5056b3 rd71fcab 39 39 */ 40 40 41 if ( !loc.ops->node_type ) 41 if ( !loc.ops->node_type ) { 42 if ( loc.ops->freenod ) 43 (*loc.ops->freenod)( &loc ); 42 44 set_errno_and_return_minus_one( ENOTSUP ); 45 } 43 46 44 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) 47 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 48 if ( loc.ops->freenod ) 49 (*loc.ops->freenod)( &loc ); 45 50 set_errno_and_return_minus_one( ENOTDIR ); 46 51 } 52 53 if ( rtems_filesystem_current.ops->freenod ) 54 (*rtems_filesystem_current.ops->freenod)( &rtems_filesystem_current ); 55 47 56 rtems_filesystem_current = loc; 48 57 -
c/src/lib/libc/chmod.c
rcb5056b3 rd71fcab 29 29 int status; 30 30 rtems_filesystem_location_info_t loc; 31 int result; 31 32 32 33 status = rtems_filesystem_evaluate_path( path, 0, &loc, TRUE ); … … 34 35 return -1; 35 36 36 if ( !loc.handlers->fchmod ) 37 if ( !loc.handlers->fchmod ){ 38 if ( loc.ops->freenod ) 39 (*loc.ops->freenod)( &loc ); 37 40 set_errno_and_return_minus_one( ENOTSUP ); 41 } 38 42 39 return (*loc.handlers->fchmod)( &loc, mode ); 43 result = (*loc.handlers->fchmod)( &loc, mode ); 44 45 if ( loc.ops->freenod ) 46 (*loc.ops->freenod)( &loc ); 47 48 return result; 40 49 } -
c/src/lib/libc/chown.c
rcb5056b3 rd71fcab 27 27 ) 28 28 { 29 rtems_filesystem_location_info_t temp_loc; 29 rtems_filesystem_location_info_t loc; 30 int result; 30 31 31 if ( rtems_filesystem_evaluate_path( path, 0x00, & temp_loc, TRUE ) )32 if ( rtems_filesystem_evaluate_path( path, 0x00, &loc, TRUE ) ) 32 33 return -1; 33 34 34 if ( !temp_loc.ops->chown ) 35 if ( !loc.ops->chown ) { 36 if ( loc.ops->freenod ) 37 (*loc.ops->freenod)( &loc ); 35 38 set_errno_and_return_minus_one( ENOTSUP ); 39 } 36 40 37 return (*temp_loc.ops->chown)( &temp_loc, owner, group ); 41 result = (*loc.ops->chown)( &loc, owner, group ); 42 43 if ( loc.ops->freenod ) 44 (*loc.ops->freenod)( &loc ); 45 46 return result; 38 47 } -
c/src/lib/libc/ioman.c
rcb5056b3 rd71fcab 62 62 * 63 63 * This version is not reentrant. 64 * 65 * XXX - This is dependent upon IMFS and should not be. 66 * Suggest adding a filesystem routine to fill in the device_info. 64 67 */ 65 68 … … 71 74 #if !defined(RTEMS_UNIX) 72 75 IMFS_jnode_t *the_jnode; 73 rtems_filesystem_location_info_t temp_loc;76 rtems_filesystem_location_info_t loc; 74 77 static rtems_driver_name_t device; 75 78 int result; 79 rtems_filesystem_node_types_t node_type; 76 80 77 result = rtems_filesystem_evaluate_path( name, 0x00, & temp_loc, TRUE );78 the_jnode = temp_loc.node_access;81 result = rtems_filesystem_evaluate_path( name, 0x00, &loc, TRUE ); 82 the_jnode = loc.node_access; 79 83 80 if ( (result != 0) || the_jnode->type != IMFS_DEVICE ) { 84 node_type = (*loc.ops->node_type)( &loc ); 85 86 if ( (result != 0) || node_type != RTEMS_FILESYSTEM_DEVICE ) { 81 87 *device_info = 0; 88 if ( loc.ops->freenod ) 89 (*loc.ops->freenod)( &loc ); 82 90 return RTEMS_UNSATISFIED; 83 91 } … … 88 96 device.minor = the_jnode->info.device.minor; 89 97 *device_info = &device; 98 99 if ( loc.ops->freenod ) 100 (*loc.ops->freenod)( &loc ); 101 90 102 #endif 91 103 return RTEMS_SUCCESSFUL; -
c/src/lib/libc/link.c
rcb5056b3 rd71fcab 33 33 * Get the node we are linking to. 34 34 */ 35 35 36 result = rtems_filesystem_evaluate_path( existing, 0, &existing_loc, TRUE ); 36 37 if ( result != 0 ) … … 43 44 rtems_filesystem_get_start_loc( new, &i, &parent_loc ); 44 45 result = (*parent_loc.ops->evalformake)( &new[i], &parent_loc, &name_start ); 45 if ( result != 0 ) 46 set_errno_and_return_minus_one( result ); 46 if ( result != 0 ) { 47 if ( existing_loc.ops->freenod ) 48 (*existing_loc.ops->freenod)( &parent_loc ); 49 set_errno_and_return_minus_one( result ); 50 } 47 51 48 52 /* … … 51 55 */ 52 56 53 if ( parent_loc.mt_entry != existing_loc.mt_entry ) 57 if ( parent_loc.mt_entry != existing_loc.mt_entry ) { 58 if ( existing_loc.ops->freenod ) 59 (*existing_loc.ops->freenod)( &existing_loc ); 60 61 if ( parent_loc.ops->freenod ) 62 (*parent_loc.ops->freenod)( &parent_loc ); 63 54 64 set_errno_and_return_minus_one( EXDEV ); 65 } 55 66 56 if ( !parent_loc.ops->link ) 67 if ( !parent_loc.ops->link ) { 68 69 if ( existing_loc.ops->freenod ) 70 (*existing_loc.ops->freenod)( &existing_loc ); 71 72 if ( parent_loc.ops->freenod ) 73 (*parent_loc.ops->freenod)( &parent_loc ); 74 57 75 set_errno_and_return_minus_one( ENOTSUP ); 76 } 58 77 59 return (*parent_loc.ops->link)( &existing_loc, &parent_loc, name_start ); 78 result = (*parent_loc.ops->link)( &existing_loc, &parent_loc, name_start ); 79 80 if ( existing_loc.ops->freenod ) 81 (*existing_loc.ops->freenod)( &existing_loc ); 82 83 if ( parent_loc.ops->freenod ) 84 (*parent_loc.ops->freenod)( &parent_loc ); 85 86 return result; 60 87 } 61 88 -
c/src/lib/libc/mknod.c
rcb5056b3 rd71fcab 53 53 return -1; 54 54 55 if ( !temp_loc.ops->mknod ) 55 if ( !temp_loc.ops->mknod ) { 56 if ( temp_loc.ops->freenod ) 57 (*temp_loc.ops->freenod)( &temp_loc ); 56 58 set_errno_and_return_minus_one( ENOTSUP ); 59 } 57 60 58 return (*temp_loc.ops->mknod)( name_start, mode, dev, &temp_loc ); 61 result = (*temp_loc.ops->mknod)( name_start, mode, dev, &temp_loc ); 62 if ( temp_loc.ops->freenod ) 63 (*temp_loc.ops->freenod)( &temp_loc ); 64 65 return result; 59 66 } -
c/src/lib/libc/mount.c
rcb5056b3 rd71fcab 89 89 rtems_filesystem_mount_table_entry_t **mt_entry, 90 90 rtems_filesystem_operations_table *fs_ops, 91 rtems_filesystem_options_t fsoptions,91 rtems_filesystem_options_t options, 92 92 char *device, 93 93 char *mount_point 94 94 ) 95 95 { 96 rtems_filesystem_location_info_t temp_loc; 97 rtems_filesystem_options_t options; 96 rtems_filesystem_location_info_t loc; 98 97 rtems_filesystem_mount_table_entry_t *temp_mt_entry; 99 98 … … 113 112 */ 114 113 115 if ( fsoptions != RTEMS_FILESYSTEM_READ_ONLY &&116 fsoptions != RTEMS_FILESYSTEM_READ_WRITE ) {114 if ( options != RTEMS_FILESYSTEM_READ_ONLY && 115 options != RTEMS_FILESYSTEM_READ_WRITE ) { 117 116 errno = EINVAL; 118 117 return -1; … … 146 145 mount_point, 147 146 RTEMS_LIBIO_PERMS_RWX, 148 & temp_loc,147 &loc, 149 148 TRUE ) == -1 ) 150 149 goto cleanup_and_bail; … … 154 153 */ 155 154 156 if ( temp_loc.ops->node_type( &temp_loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {155 if ( loc.ops->node_type( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 157 156 errno = ENOTDIR; 158 157 goto cleanup_and_bail; … … 163 162 */ 164 163 165 if ( search_mt_for_mount_point( & temp_loc ) == FOUND ) {164 if ( search_mt_for_mount_point( &loc ) == FOUND ) { 166 165 errno = EBUSY; 167 166 goto cleanup_and_bail; … … 173 172 */ 174 173 175 temp_mt_entry->mt_point_node.node_access = temp_loc.node_access;176 temp_mt_entry->mt_point_node.handlers = temp_loc.handlers;177 temp_mt_entry->mt_point_node.ops = temp_loc.ops;178 temp_mt_entry->mt_point_node.mt_entry = temp_loc.mt_entry;174 temp_mt_entry->mt_point_node.node_access = loc.node_access; 175 temp_mt_entry->mt_point_node.handlers = loc.handlers; 176 temp_mt_entry->mt_point_node.ops = loc.ops; 177 temp_mt_entry->mt_point_node.mt_entry = loc.mt_entry; 179 178 180 179 /* … … 183 182 */ 184 183 185 if ( ! temp_loc.ops->mount ){184 if ( !loc.ops->mount ){ 186 185 errno = ENOTSUP; 187 186 goto cleanup_and_bail; 188 187 } 189 188 190 if ( temp_loc.ops->mount( temp_mt_entry ) ) {189 if ( loc.ops->mount( temp_mt_entry ) ) { 191 190 goto cleanup_and_bail; 192 191 } … … 225 224 226 225 *mt_entry = temp_mt_entry; 226 227 if ( loc.ops->freenod ) 228 (*loc.ops->freenod)( &loc ); 229 227 230 return 0; 228 231 … … 230 233 231 234 free( temp_mt_entry ); 235 236 if ( loc.ops->freenod ) 237 (*loc.ops->freenod)( &loc ); 238 232 239 return -1; 233 240 } -
c/src/lib/libc/open.c
rcb5056b3 rd71fcab 63 63 rtems_libio_t *iop = 0; 64 64 int status; 65 rtems_filesystem_location_info_t temp_loc;65 rtems_filesystem_location_info_t loc; 66 66 int eval_flags; 67 67 … … 105 105 106 106 status = rtems_filesystem_evaluate_path( 107 pathname, eval_flags, & temp_loc, TRUE );107 pathname, eval_flags, &loc, TRUE ); 108 108 109 109 if ( status == -1 ) { … … 127 127 128 128 /* Sanity check to see if the file name exists after the mknod() */ 129 status = rtems_filesystem_evaluate_path( pathname, 0x0, & temp_loc, TRUE );129 status = rtems_filesystem_evaluate_path( pathname, 0x0, &loc, TRUE ); 130 130 if ( status != 0 ) { /* The file did not exist */ 131 131 rc = EACCES; … … 140 140 141 141 /* 142 * Fill in the file control block based on the temp_loc structure142 * Fill in the file control block based on the loc structure 143 143 * returned by successful path evaluation. 144 144 */ 145 145 146 146 iop->offset = 0; 147 iop->handlers = temp_loc.handlers;148 iop->file_info = temp_loc.node_access;147 iop->handlers = loc.handlers; 148 iop->file_info = loc.node_access; 149 149 iop->flags |= rtems_libio_fcntl_flags( flags ); 150 iop->pathinfo = temp_loc;150 iop->pathinfo = loc; 151 151 152 152 if ( !iop->handlers->open ) { … … 179 179 set_errno_and_return_minus_one( rc ); 180 180 } 181 182 if ( loc.ops->freenod ) 183 (*loc.ops->freenod)( &loc ); 184 181 185 return iop - rtems_libio_iops; 182 186 } -
c/src/lib/libc/readlink.c
rcb5056b3 rd71fcab 24 24 int result; 25 25 26 if (!buf) 27 set_errno_and_return_minus_one( EFAULT ); 28 26 29 result = rtems_filesystem_evaluate_path( pathname, 0, &loc, FALSE ); 27 30 if ( result != 0 ) 28 31 return -1; 29 32 30 if (!buf) 31 set_errno_and_return_minus_one( EFAULT ); 33 if ( !loc.ops->node_type ){ 34 if ( loc.ops->freenod ) 35 (*loc.ops->freenod)( &loc ); 36 set_errno_and_return_minus_one( ENOTSUP ); 37 } 32 38 33 if ( !loc.ops->node_type ) 39 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){ 40 if ( loc.ops->freenod ) 41 (*loc.ops->freenod)( &loc ); 42 set_errno_and_return_minus_one( EINVAL ); 43 } 44 45 if ( !loc.ops->readlink ){ 46 if ( loc.ops->freenod ) 47 (*loc.ops->freenod)( &loc ); 34 48 set_errno_and_return_minus_one( ENOTSUP ); 49 } 35 50 36 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ) 37 set_errno_and_return_minus_one( EINVAL ); 51 result = (*loc.ops->readlink)( &loc, buf, bufsize ); 38 52 39 if ( !loc.ops->readlink)40 set_errno_and_return_minus_one( ENOTSUP);41 42 return (*loc.ops->readlink)( &loc, buf, bufsize );53 if ( loc.ops->freenod ) 54 (*loc.ops->freenod)( &loc ); 55 56 return result; 43 57 } -
c/src/lib/libc/rmdir.c
rcb5056b3 rd71fcab 40 40 */ 41 41 42 if ( !loc.ops->node_type ) 42 if ( !loc.ops->node_type ){ 43 if ( loc.ops->freenod ) 44 (*loc.ops->freenod)( &loc ); 43 45 set_errno_and_return_minus_one( ENOTSUP ); 46 } 44 47 45 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) 48 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ){ 49 if ( loc.ops->freenod ) 50 (*loc.ops->freenod)( &loc ); 46 51 set_errno_and_return_minus_one( ENOTDIR ); 52 } 47 53 48 54 /* … … 50 56 */ 51 57 52 if ( !loc.ops->rmnod ) 58 if ( !loc.ops->rmnod ){ 59 if ( loc.ops->freenod ) 60 (*loc.ops->freenod)( &loc ); 53 61 set_errno_and_return_minus_one( ENOTSUP ); 62 } 54 63 55 return (*loc.ops->rmnod)( &loc ); 64 result = (*loc.ops->rmnod)( &loc ); 65 66 if ( loc.ops->freenod ) 67 (*loc.ops->freenod)( &loc ); 68 69 return result; 56 70 } -
c/src/lib/libc/stat.c
rcb5056b3 rd71fcab 59 59 return -1; 60 60 61 if ( !loc.handlers->fstat ) 61 if ( !loc.handlers->fstat ){ 62 if ( loc.ops->freenod ) 63 (*loc.ops->freenod)( &loc ); 62 64 set_errno_and_return_minus_one( ENOTSUP ); 65 } 63 66 64 67 /* … … 69 72 memset( buf, 0, sizeof(struct stat) ); 70 73 71 return (*loc.handlers->fstat)( &loc, buf ); 74 status = (*loc.handlers->fstat)( &loc, buf ); 75 76 if ( loc.ops->freenod ) 77 (*loc.ops->freenod)( &loc ); 78 79 return status; 72 80 } 73 81 #endif -
c/src/lib/libc/symlink.c
rcb5056b3 rd71fcab 30 30 return -1; 31 31 32 return (*loc.ops->symlink)( &loc, actualpath, name_start); 32 result = (*loc.ops->symlink)( &loc, actualpath, name_start); 33 34 if ( loc.ops->freenod ) 35 (*loc.ops->freenod)( &loc ); 36 37 return result; 33 38 } 34 39 -
c/src/lib/libc/unlink.c
rcb5056b3 rd71fcab 32 32 return -1; 33 33 34 if ( !loc.ops->node_type ) 34 if ( !loc.ops->node_type ) { 35 if ( loc.ops->freenod ) 36 (*loc.ops->freenod)( &loc ); 35 37 set_errno_and_return_minus_one( ENOTSUP ); 38 } 36 39 37 if ( (*loc.ops->node_type)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) 40 if ( (*loc.ops->node_type)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) { 41 if ( loc.ops->freenod ) 42 (*loc.ops->freenod)( &loc ); 38 43 set_errno_and_return_minus_one( EISDIR ); 44 } 45 46 if ( !loc.ops->unlink ) { 47 if ( loc.ops->freenod ) 48 (*loc.ops->freenod)( &loc ); 49 set_errno_and_return_minus_one( ENOTSUP ); 50 } 51 52 result = (*loc.ops->unlink)( &loc ); 53 54 if ( loc.ops->freenod ) 55 (*loc.ops->freenod)( &loc ); 39 56 40 if ( !loc.ops->unlink ) 41 set_errno_and_return_minus_one( ENOTSUP ); 42 43 return (*loc.ops->unlink)( &loc ); 57 return result; 44 58 } 45 59 -
c/src/lib/libc/unmount.c
rcb5056b3 rd71fcab 84 84 */ 85 85 86 if ( rtems_filesystem_current.mt_entry == temp_loc.mt_entry ) 86 if ( rtems_filesystem_current.mt_entry == temp_loc.mt_entry ) { 87 if ( temp_loc.ops->freenod ) 88 (*temp_loc.ops->freenod)( &temp_loc ); 87 89 set_errno_and_return_minus_one( EBUSY ); 90 } 88 91 89 92 /* … … 93 96 */ 94 97 95 if ( rtems_libio_is_open_files_in_fs( temp_loc.mt_entry ) == 1 ) 98 if ( rtems_libio_is_open_files_in_fs( temp_loc.mt_entry ) == 1 ) { 99 if ( temp_loc.ops->freenod ) 100 (*temp_loc.ops->freenod)( &temp_loc ); 96 101 set_errno_and_return_minus_one( EBUSY ); 102 } 97 103 98 104 /* … … 104 110 */ 105 111 106 if ( ( temp_mt_entry.mt_point_node.ops->unmount )( temp_loc.mt_entry ) != 0 ) 112 if ((temp_mt_entry.mt_point_node.ops->unmount )( temp_loc.mt_entry ) != 0 ) { 113 if ( temp_loc.ops->freenod ) 114 (*temp_loc.ops->freenod)( &temp_loc ); 115 return -1; 116 } 117 118 /* 119 * Run the unmount function for the subordinate file system. 120 */ 121 122 if ((temp_mt_entry.mt_fs_root.ops->fsunmount_me )( temp_loc.mt_entry ) != 0){ 123 if ( temp_loc.ops->freenod ) 124 (*temp_loc.ops->freenod)( &temp_loc ); 107 125 return -1; 108 109 /* 110 * Run the unmount function for the subordinate file system. 111 */ 112 113 if ( ( temp_mt_entry.mt_fs_root.ops->fsunmount_me )( temp_loc.mt_entry ) != 0 ) 114 return -1; 126 } 115 127 116 128 /* … … 131 143 132 144 free( temp_loc.mt_entry ); 145 if ( temp_loc.ops->freenod ) 146 (*temp_loc.ops->freenod)( &temp_loc ); 133 147 134 148 return result; -
c/src/lib/libc/utime.c
rcb5056b3 rd71fcab 25 25 { 26 26 rtems_filesystem_location_info_t temp_loc; 27 int result; 28 29 if ( !temp_loc.ops->utime ) 30 set_errno_and_return_minus_one( ENOTSUP ); 27 31 28 32 if ( rtems_filesystem_evaluate_path( path, 0x00, &temp_loc, TRUE ) ) 29 33 return -1; 30 34 31 if ( !temp_loc.ops->utime ) 32 set_errno_and_return_minus_one( ENOTSUP ); 35 result = (*temp_loc.ops->utime)( &temp_loc, times->actime, times->modtime ); 33 36 34 return (*temp_loc.ops->utime)( &temp_loc, times->actime, times->modtime ); 37 if ( temp_loc.ops->freenod ) 38 (*temp_loc.ops->freenod)( &temp_loc ); 39 40 return result; 35 41 } -
c/src/libfs/src/imfs/ioman.c
rcb5056b3 rd71fcab 62 62 * 63 63 * This version is not reentrant. 64 * 65 * XXX - This is dependent upon IMFS and should not be. 66 * Suggest adding a filesystem routine to fill in the device_info. 64 67 */ 65 68 … … 71 74 #if !defined(RTEMS_UNIX) 72 75 IMFS_jnode_t *the_jnode; 73 rtems_filesystem_location_info_t temp_loc;76 rtems_filesystem_location_info_t loc; 74 77 static rtems_driver_name_t device; 75 78 int result; 79 rtems_filesystem_node_types_t node_type; 76 80 77 result = rtems_filesystem_evaluate_path( name, 0x00, & temp_loc, TRUE );78 the_jnode = temp_loc.node_access;81 result = rtems_filesystem_evaluate_path( name, 0x00, &loc, TRUE ); 82 the_jnode = loc.node_access; 79 83 80 if ( (result != 0) || the_jnode->type != IMFS_DEVICE ) { 84 node_type = (*loc.ops->node_type)( &loc ); 85 86 if ( (result != 0) || node_type != RTEMS_FILESYSTEM_DEVICE ) { 81 87 *device_info = 0; 88 if ( loc.ops->freenod ) 89 (*loc.ops->freenod)( &loc ); 82 90 return RTEMS_UNSATISFIED; 83 91 } … … 88 96 device.minor = the_jnode->info.device.minor; 89 97 *device_info = &device; 98 99 if ( loc.ops->freenod ) 100 (*loc.ops->freenod)( &loc ); 101 90 102 #endif 91 103 return RTEMS_SUCCESSFUL; -
cpukit/libcsupport/src/chdir.c
rcb5056b3 rd71fcab 39 39 */ 40 40 41 if ( !loc.ops->node_type ) 41 if ( !loc.ops->node_type ) { 42 if ( loc.ops->freenod ) 43 (*loc.ops->freenod)( &loc ); 42 44 set_errno_and_return_minus_one( ENOTSUP ); 45 } 43 46 44 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) 47 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 48 if ( loc.ops->freenod ) 49 (*loc.ops->freenod)( &loc ); 45 50 set_errno_and_return_minus_one( ENOTDIR ); 46 51 } 52 53 if ( rtems_filesystem_current.ops->freenod ) 54 (*rtems_filesystem_current.ops->freenod)( &rtems_filesystem_current ); 55 47 56 rtems_filesystem_current = loc; 48 57 -
cpukit/libcsupport/src/chmod.c
rcb5056b3 rd71fcab 29 29 int status; 30 30 rtems_filesystem_location_info_t loc; 31 int result; 31 32 32 33 status = rtems_filesystem_evaluate_path( path, 0, &loc, TRUE ); … … 34 35 return -1; 35 36 36 if ( !loc.handlers->fchmod ) 37 if ( !loc.handlers->fchmod ){ 38 if ( loc.ops->freenod ) 39 (*loc.ops->freenod)( &loc ); 37 40 set_errno_and_return_minus_one( ENOTSUP ); 41 } 38 42 39 return (*loc.handlers->fchmod)( &loc, mode ); 43 result = (*loc.handlers->fchmod)( &loc, mode ); 44 45 if ( loc.ops->freenod ) 46 (*loc.ops->freenod)( &loc ); 47 48 return result; 40 49 } -
cpukit/libcsupport/src/chown.c
rcb5056b3 rd71fcab 27 27 ) 28 28 { 29 rtems_filesystem_location_info_t temp_loc; 29 rtems_filesystem_location_info_t loc; 30 int result; 30 31 31 if ( rtems_filesystem_evaluate_path( path, 0x00, & temp_loc, TRUE ) )32 if ( rtems_filesystem_evaluate_path( path, 0x00, &loc, TRUE ) ) 32 33 return -1; 33 34 34 if ( !temp_loc.ops->chown ) 35 if ( !loc.ops->chown ) { 36 if ( loc.ops->freenod ) 37 (*loc.ops->freenod)( &loc ); 35 38 set_errno_and_return_minus_one( ENOTSUP ); 39 } 36 40 37 return (*temp_loc.ops->chown)( &temp_loc, owner, group ); 41 result = (*loc.ops->chown)( &loc, owner, group ); 42 43 if ( loc.ops->freenod ) 44 (*loc.ops->freenod)( &loc ); 45 46 return result; 38 47 } -
cpukit/libcsupport/src/link.c
rcb5056b3 rd71fcab 33 33 * Get the node we are linking to. 34 34 */ 35 35 36 result = rtems_filesystem_evaluate_path( existing, 0, &existing_loc, TRUE ); 36 37 if ( result != 0 ) … … 43 44 rtems_filesystem_get_start_loc( new, &i, &parent_loc ); 44 45 result = (*parent_loc.ops->evalformake)( &new[i], &parent_loc, &name_start ); 45 if ( result != 0 ) 46 set_errno_and_return_minus_one( result ); 46 if ( result != 0 ) { 47 if ( existing_loc.ops->freenod ) 48 (*existing_loc.ops->freenod)( &parent_loc ); 49 set_errno_and_return_minus_one( result ); 50 } 47 51 48 52 /* … … 51 55 */ 52 56 53 if ( parent_loc.mt_entry != existing_loc.mt_entry ) 57 if ( parent_loc.mt_entry != existing_loc.mt_entry ) { 58 if ( existing_loc.ops->freenod ) 59 (*existing_loc.ops->freenod)( &existing_loc ); 60 61 if ( parent_loc.ops->freenod ) 62 (*parent_loc.ops->freenod)( &parent_loc ); 63 54 64 set_errno_and_return_minus_one( EXDEV ); 65 } 55 66 56 if ( !parent_loc.ops->link ) 67 if ( !parent_loc.ops->link ) { 68 69 if ( existing_loc.ops->freenod ) 70 (*existing_loc.ops->freenod)( &existing_loc ); 71 72 if ( parent_loc.ops->freenod ) 73 (*parent_loc.ops->freenod)( &parent_loc ); 74 57 75 set_errno_and_return_minus_one( ENOTSUP ); 76 } 58 77 59 return (*parent_loc.ops->link)( &existing_loc, &parent_loc, name_start ); 78 result = (*parent_loc.ops->link)( &existing_loc, &parent_loc, name_start ); 79 80 if ( existing_loc.ops->freenod ) 81 (*existing_loc.ops->freenod)( &existing_loc ); 82 83 if ( parent_loc.ops->freenod ) 84 (*parent_loc.ops->freenod)( &parent_loc ); 85 86 return result; 60 87 } 61 88 -
cpukit/libcsupport/src/mknod.c
rcb5056b3 rd71fcab 53 53 return -1; 54 54 55 if ( !temp_loc.ops->mknod ) 55 if ( !temp_loc.ops->mknod ) { 56 if ( temp_loc.ops->freenod ) 57 (*temp_loc.ops->freenod)( &temp_loc ); 56 58 set_errno_and_return_minus_one( ENOTSUP ); 59 } 57 60 58 return (*temp_loc.ops->mknod)( name_start, mode, dev, &temp_loc ); 61 result = (*temp_loc.ops->mknod)( name_start, mode, dev, &temp_loc ); 62 if ( temp_loc.ops->freenod ) 63 (*temp_loc.ops->freenod)( &temp_loc ); 64 65 return result; 59 66 } -
cpukit/libcsupport/src/mount.c
rcb5056b3 rd71fcab 89 89 rtems_filesystem_mount_table_entry_t **mt_entry, 90 90 rtems_filesystem_operations_table *fs_ops, 91 rtems_filesystem_options_t fsoptions,91 rtems_filesystem_options_t options, 92 92 char *device, 93 93 char *mount_point 94 94 ) 95 95 { 96 rtems_filesystem_location_info_t temp_loc; 97 rtems_filesystem_options_t options; 96 rtems_filesystem_location_info_t loc; 98 97 rtems_filesystem_mount_table_entry_t *temp_mt_entry; 99 98 … … 113 112 */ 114 113 115 if ( fsoptions != RTEMS_FILESYSTEM_READ_ONLY &&116 fsoptions != RTEMS_FILESYSTEM_READ_WRITE ) {114 if ( options != RTEMS_FILESYSTEM_READ_ONLY && 115 options != RTEMS_FILESYSTEM_READ_WRITE ) { 117 116 errno = EINVAL; 118 117 return -1; … … 146 145 mount_point, 147 146 RTEMS_LIBIO_PERMS_RWX, 148 & temp_loc,147 &loc, 149 148 TRUE ) == -1 ) 150 149 goto cleanup_and_bail; … … 154 153 */ 155 154 156 if ( temp_loc.ops->node_type( &temp_loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {155 if ( loc.ops->node_type( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 157 156 errno = ENOTDIR; 158 157 goto cleanup_and_bail; … … 163 162 */ 164 163 165 if ( search_mt_for_mount_point( & temp_loc ) == FOUND ) {164 if ( search_mt_for_mount_point( &loc ) == FOUND ) { 166 165 errno = EBUSY; 167 166 goto cleanup_and_bail; … … 173 172 */ 174 173 175 temp_mt_entry->mt_point_node.node_access = temp_loc.node_access;176 temp_mt_entry->mt_point_node.handlers = temp_loc.handlers;177 temp_mt_entry->mt_point_node.ops = temp_loc.ops;178 temp_mt_entry->mt_point_node.mt_entry = temp_loc.mt_entry;174 temp_mt_entry->mt_point_node.node_access = loc.node_access; 175 temp_mt_entry->mt_point_node.handlers = loc.handlers; 176 temp_mt_entry->mt_point_node.ops = loc.ops; 177 temp_mt_entry->mt_point_node.mt_entry = loc.mt_entry; 179 178 180 179 /* … … 183 182 */ 184 183 185 if ( ! temp_loc.ops->mount ){184 if ( !loc.ops->mount ){ 186 185 errno = ENOTSUP; 187 186 goto cleanup_and_bail; 188 187 } 189 188 190 if ( temp_loc.ops->mount( temp_mt_entry ) ) {189 if ( loc.ops->mount( temp_mt_entry ) ) { 191 190 goto cleanup_and_bail; 192 191 } … … 225 224 226 225 *mt_entry = temp_mt_entry; 226 227 if ( loc.ops->freenod ) 228 (*loc.ops->freenod)( &loc ); 229 227 230 return 0; 228 231 … … 230 233 231 234 free( temp_mt_entry ); 235 236 if ( loc.ops->freenod ) 237 (*loc.ops->freenod)( &loc ); 238 232 239 return -1; 233 240 } -
cpukit/libcsupport/src/open.c
rcb5056b3 rd71fcab 63 63 rtems_libio_t *iop = 0; 64 64 int status; 65 rtems_filesystem_location_info_t temp_loc;65 rtems_filesystem_location_info_t loc; 66 66 int eval_flags; 67 67 … … 105 105 106 106 status = rtems_filesystem_evaluate_path( 107 pathname, eval_flags, & temp_loc, TRUE );107 pathname, eval_flags, &loc, TRUE ); 108 108 109 109 if ( status == -1 ) { … … 127 127 128 128 /* Sanity check to see if the file name exists after the mknod() */ 129 status = rtems_filesystem_evaluate_path( pathname, 0x0, & temp_loc, TRUE );129 status = rtems_filesystem_evaluate_path( pathname, 0x0, &loc, TRUE ); 130 130 if ( status != 0 ) { /* The file did not exist */ 131 131 rc = EACCES; … … 140 140 141 141 /* 142 * Fill in the file control block based on the temp_loc structure142 * Fill in the file control block based on the loc structure 143 143 * returned by successful path evaluation. 144 144 */ 145 145 146 146 iop->offset = 0; 147 iop->handlers = temp_loc.handlers;148 iop->file_info = temp_loc.node_access;147 iop->handlers = loc.handlers; 148 iop->file_info = loc.node_access; 149 149 iop->flags |= rtems_libio_fcntl_flags( flags ); 150 iop->pathinfo = temp_loc;150 iop->pathinfo = loc; 151 151 152 152 if ( !iop->handlers->open ) { … … 179 179 set_errno_and_return_minus_one( rc ); 180 180 } 181 182 if ( loc.ops->freenod ) 183 (*loc.ops->freenod)( &loc ); 184 181 185 return iop - rtems_libio_iops; 182 186 } -
cpukit/libcsupport/src/readlink.c
rcb5056b3 rd71fcab 24 24 int result; 25 25 26 if (!buf) 27 set_errno_and_return_minus_one( EFAULT ); 28 26 29 result = rtems_filesystem_evaluate_path( pathname, 0, &loc, FALSE ); 27 30 if ( result != 0 ) 28 31 return -1; 29 32 30 if (!buf) 31 set_errno_and_return_minus_one( EFAULT ); 33 if ( !loc.ops->node_type ){ 34 if ( loc.ops->freenod ) 35 (*loc.ops->freenod)( &loc ); 36 set_errno_and_return_minus_one( ENOTSUP ); 37 } 32 38 33 if ( !loc.ops->node_type ) 39 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){ 40 if ( loc.ops->freenod ) 41 (*loc.ops->freenod)( &loc ); 42 set_errno_and_return_minus_one( EINVAL ); 43 } 44 45 if ( !loc.ops->readlink ){ 46 if ( loc.ops->freenod ) 47 (*loc.ops->freenod)( &loc ); 34 48 set_errno_and_return_minus_one( ENOTSUP ); 49 } 35 50 36 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ) 37 set_errno_and_return_minus_one( EINVAL ); 51 result = (*loc.ops->readlink)( &loc, buf, bufsize ); 38 52 39 if ( !loc.ops->readlink)40 set_errno_and_return_minus_one( ENOTSUP);41 42 return (*loc.ops->readlink)( &loc, buf, bufsize );53 if ( loc.ops->freenod ) 54 (*loc.ops->freenod)( &loc ); 55 56 return result; 43 57 } -
cpukit/libcsupport/src/rmdir.c
rcb5056b3 rd71fcab 40 40 */ 41 41 42 if ( !loc.ops->node_type ) 42 if ( !loc.ops->node_type ){ 43 if ( loc.ops->freenod ) 44 (*loc.ops->freenod)( &loc ); 43 45 set_errno_and_return_minus_one( ENOTSUP ); 46 } 44 47 45 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) 48 if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ){ 49 if ( loc.ops->freenod ) 50 (*loc.ops->freenod)( &loc ); 46 51 set_errno_and_return_minus_one( ENOTDIR ); 52 } 47 53 48 54 /* … … 50 56 */ 51 57 52 if ( !loc.ops->rmnod ) 58 if ( !loc.ops->rmnod ){ 59 if ( loc.ops->freenod ) 60 (*loc.ops->freenod)( &loc ); 53 61 set_errno_and_return_minus_one( ENOTSUP ); 62 } 54 63 55 return (*loc.ops->rmnod)( &loc ); 64 result = (*loc.ops->rmnod)( &loc ); 65 66 if ( loc.ops->freenod ) 67 (*loc.ops->freenod)( &loc ); 68 69 return result; 56 70 } -
cpukit/libcsupport/src/stat.c
rcb5056b3 rd71fcab 59 59 return -1; 60 60 61 if ( !loc.handlers->fstat ) 61 if ( !loc.handlers->fstat ){ 62 if ( loc.ops->freenod ) 63 (*loc.ops->freenod)( &loc ); 62 64 set_errno_and_return_minus_one( ENOTSUP ); 65 } 63 66 64 67 /* … … 69 72 memset( buf, 0, sizeof(struct stat) ); 70 73 71 return (*loc.handlers->fstat)( &loc, buf ); 74 status = (*loc.handlers->fstat)( &loc, buf ); 75 76 if ( loc.ops->freenod ) 77 (*loc.ops->freenod)( &loc ); 78 79 return status; 72 80 } 73 81 #endif -
cpukit/libcsupport/src/symlink.c
rcb5056b3 rd71fcab 30 30 return -1; 31 31 32 return (*loc.ops->symlink)( &loc, actualpath, name_start); 32 result = (*loc.ops->symlink)( &loc, actualpath, name_start); 33 34 if ( loc.ops->freenod ) 35 (*loc.ops->freenod)( &loc ); 36 37 return result; 33 38 } 34 39 -
cpukit/libcsupport/src/unlink.c
rcb5056b3 rd71fcab 32 32 return -1; 33 33 34 if ( !loc.ops->node_type ) 34 if ( !loc.ops->node_type ) { 35 if ( loc.ops->freenod ) 36 (*loc.ops->freenod)( &loc ); 35 37 set_errno_and_return_minus_one( ENOTSUP ); 38 } 36 39 37 if ( (*loc.ops->node_type)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) 40 if ( (*loc.ops->node_type)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) { 41 if ( loc.ops->freenod ) 42 (*loc.ops->freenod)( &loc ); 38 43 set_errno_and_return_minus_one( EISDIR ); 44 } 45 46 if ( !loc.ops->unlink ) { 47 if ( loc.ops->freenod ) 48 (*loc.ops->freenod)( &loc ); 49 set_errno_and_return_minus_one( ENOTSUP ); 50 } 51 52 result = (*loc.ops->unlink)( &loc ); 53 54 if ( loc.ops->freenod ) 55 (*loc.ops->freenod)( &loc ); 39 56 40 if ( !loc.ops->unlink ) 41 set_errno_and_return_minus_one( ENOTSUP ); 42 43 return (*loc.ops->unlink)( &loc ); 57 return result; 44 58 } 45 59 -
cpukit/libcsupport/src/unmount.c
rcb5056b3 rd71fcab 84 84 */ 85 85 86 if ( rtems_filesystem_current.mt_entry == temp_loc.mt_entry ) 86 if ( rtems_filesystem_current.mt_entry == temp_loc.mt_entry ) { 87 if ( temp_loc.ops->freenod ) 88 (*temp_loc.ops->freenod)( &temp_loc ); 87 89 set_errno_and_return_minus_one( EBUSY ); 90 } 88 91 89 92 /* … … 93 96 */ 94 97 95 if ( rtems_libio_is_open_files_in_fs( temp_loc.mt_entry ) == 1 ) 98 if ( rtems_libio_is_open_files_in_fs( temp_loc.mt_entry ) == 1 ) { 99 if ( temp_loc.ops->freenod ) 100 (*temp_loc.ops->freenod)( &temp_loc ); 96 101 set_errno_and_return_minus_one( EBUSY ); 102 } 97 103 98 104 /* … … 104 110 */ 105 111 106 if ( ( temp_mt_entry.mt_point_node.ops->unmount )( temp_loc.mt_entry ) != 0 ) 112 if ((temp_mt_entry.mt_point_node.ops->unmount )( temp_loc.mt_entry ) != 0 ) { 113 if ( temp_loc.ops->freenod ) 114 (*temp_loc.ops->freenod)( &temp_loc ); 115 return -1; 116 } 117 118 /* 119 * Run the unmount function for the subordinate file system. 120 */ 121 122 if ((temp_mt_entry.mt_fs_root.ops->fsunmount_me )( temp_loc.mt_entry ) != 0){ 123 if ( temp_loc.ops->freenod ) 124 (*temp_loc.ops->freenod)( &temp_loc ); 107 125 return -1; 108 109 /* 110 * Run the unmount function for the subordinate file system. 111 */ 112 113 if ( ( temp_mt_entry.mt_fs_root.ops->fsunmount_me )( temp_loc.mt_entry ) != 0 ) 114 return -1; 126 } 115 127 116 128 /* … … 131 143 132 144 free( temp_loc.mt_entry ); 145 if ( temp_loc.ops->freenod ) 146 (*temp_loc.ops->freenod)( &temp_loc ); 133 147 134 148 return result; -
cpukit/libcsupport/src/utime.c
rcb5056b3 rd71fcab 25 25 { 26 26 rtems_filesystem_location_info_t temp_loc; 27 int result; 28 29 if ( !temp_loc.ops->utime ) 30 set_errno_and_return_minus_one( ENOTSUP ); 27 31 28 32 if ( rtems_filesystem_evaluate_path( path, 0x00, &temp_loc, TRUE ) ) 29 33 return -1; 30 34 31 if ( !temp_loc.ops->utime ) 32 set_errno_and_return_minus_one( ENOTSUP ); 35 result = (*temp_loc.ops->utime)( &temp_loc, times->actime, times->modtime ); 33 36 34 return (*temp_loc.ops->utime)( &temp_loc, times->actime, times->modtime ); 37 if ( temp_loc.ops->freenod ) 38 (*temp_loc.ops->freenod)( &temp_loc ); 39 40 return result; 35 41 } -
cpukit/libfs/src/imfs/ioman.c
rcb5056b3 rd71fcab 62 62 * 63 63 * This version is not reentrant. 64 * 65 * XXX - This is dependent upon IMFS and should not be. 66 * Suggest adding a filesystem routine to fill in the device_info. 64 67 */ 65 68 … … 71 74 #if !defined(RTEMS_UNIX) 72 75 IMFS_jnode_t *the_jnode; 73 rtems_filesystem_location_info_t temp_loc;76 rtems_filesystem_location_info_t loc; 74 77 static rtems_driver_name_t device; 75 78 int result; 79 rtems_filesystem_node_types_t node_type; 76 80 77 result = rtems_filesystem_evaluate_path( name, 0x00, & temp_loc, TRUE );78 the_jnode = temp_loc.node_access;81 result = rtems_filesystem_evaluate_path( name, 0x00, &loc, TRUE ); 82 the_jnode = loc.node_access; 79 83 80 if ( (result != 0) || the_jnode->type != IMFS_DEVICE ) { 84 node_type = (*loc.ops->node_type)( &loc ); 85 86 if ( (result != 0) || node_type != RTEMS_FILESYSTEM_DEVICE ) { 81 87 *device_info = 0; 88 if ( loc.ops->freenod ) 89 (*loc.ops->freenod)( &loc ); 82 90 return RTEMS_UNSATISFIED; 83 91 } … … 88 96 device.minor = the_jnode->info.device.minor; 89 97 *device_info = &device; 98 99 if ( loc.ops->freenod ) 100 (*loc.ops->freenod)( &loc ); 101 90 102 #endif 91 103 return RTEMS_SUCCESSFUL;
Note: See TracChangeset
for help on using the changeset viewer.