Changeset 94b357c2 in rtems
- Timestamp:
- 11/05/99 21:10:54 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 378fe02
- Parents:
- 6c85bdd
- Files:
-
- 4 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/libfs/src/imfs/deviceio.c
r6c85bdd r94b357c2 213 213 * device_stat 214 214 * 215 * Th isIMFS_stat() is used.215 * The IMFS_stat() is used. 216 216 */ 217 217 218 218 /* 219 219 * device_rmnod 220 */ 221 222 int device_rmnod( 223 rtems_filesystem_location_info_t *pathloc /* IN */ 224 ) 225 { 226 IMFS_jnode_t *the_jnode; 227 228 the_jnode = (IMFS_jnode_t *) pathloc->node_access; 229 230 /* 231 * Take the node out of the parent's chain that contains this node 232 */ 233 234 if ( the_jnode->Parent != NULL ) { 235 Chain_Extract( (Chain_Node *) the_jnode ); 236 the_jnode->Parent = NULL; 237 } 238 239 /* 240 * Decrement the link counter and see if we can free the space. 241 */ 242 243 the_jnode->st_nlink--; 244 IMFS_update_ctime( the_jnode ); 245 246 /* 247 * The file cannot be open and the link must be less than 1 to free. 248 */ 249 250 if ( !rtems_libio_is_file_open( the_jnode ) && (the_jnode->st_nlink < 1) ) { 251 252 /* 253 * Is the rtems_filesystem_current is this node? 254 */ 255 256 if ( rtems_filesystem_current.node_access == pathloc->node_access ) 257 rtems_filesystem_current.node_access = NULL; 258 259 /* 260 * Free memory associated with a memory file. 261 */ 262 263 free( the_jnode ); 264 } 265 266 return 0; 267 268 } 269 270 271 220 * 221 * The IMFS_rmnod() is used. 222 */ -
c/src/exec/libfs/src/imfs/imfs.h
r6c85bdd r94b357c2 213 213 */ 214 214 215 extern rtems_filesystem_file_handlers_r IMFS_directory_handlers; 215 216 extern rtems_filesystem_file_handlers_r IMFS_device_handlers; 217 extern rtems_filesystem_file_handlers_r IMFS_link_handlers; 216 218 extern rtems_filesystem_file_handlers_r IMFS_memfile_handlers; 217 extern rtems_filesystem_file_handlers_r IMFS_directory_handlers;218 219 extern rtems_filesystem_operations_table IMFS_ops; 219 220 extern rtems_filesystem_operations_table miniIMFS_ops; … … 457 458 ); 458 459 459 int device_rmnod(460 rtems_filesystem_location_info_t *pathloc /* IN */461 );462 463 460 int IMFS_utime( 464 461 rtems_filesystem_location_info_t *pathloc, /* IN */ … … 493 490 ); 494 491 492 int IMFS_rmnod( 493 rtems_filesystem_location_info_t *pathloc /* IN */ 494 ); 495 495 496 #ifdef __cplusplus 496 497 } -
c/src/exec/libfs/src/imfs/imfs_eval.c
r6c85bdd r94b357c2 46 46 case IMFS_SYM_LINK: 47 47 case IMFS_HARD_LINK: 48 loc->handlers = & rtems_filesystem_null_handlers;48 loc->handlers = &IMFS_link_handlers; 49 49 break; 50 50 case IMFS_MEMORY_FILE: -
c/src/exec/libfs/src/imfs/imfs_fsunmount.c
r6c85bdd r94b357c2 43 43 ((IMFS_jnode_t *)( Chain_Head( jnode_get_control( jnode ) )->next)) 44 44 45 /* XXX should be in a more public place */ 46 47 extern int IMFS_Set_handlers( 48 rtems_filesystem_location_info_t *loc 49 ); 45 50 46 51 int IMFS_fsunmount( … … 60 65 jnode = (IMFS_jnode_t *)temp_mt_entry->mt_fs_root.node_access; 61 66 loc = temp_mt_entry->mt_fs_root; 62 63 67 64 68 /* … … 71 75 next = jnode->Parent; 72 76 loc.node_access = (void *)jnode; 77 IMFS_Set_handlers( &loc ); 73 78 74 79 if ( jnode->type != IMFS_DIRECTORY ) { -
c/src/exec/libfs/src/imfs/imfs_handlers_device.c
r6c85bdd r94b357c2 35 35 NULL, /* fdatasync */ 36 36 NULL, /* fcntl */ 37 device_rmnod37 IMFS_rmnod 38 38 }; -
c/src/exec/libfs/src/imfs/imfs_unlink.c
r6c85bdd r94b357c2 50 50 51 51 /* 52 * If this is the last referance to the node53 * Free the node that the link points to.52 * If removing the last hard link to a node, then we need 53 * to remove the node that is a link and the node itself. 54 54 */ 55 55 56 node->info.hard_link.link_node->st_nlink --; 56 57 IMFS_update_ctime( node->info.hard_link.link_node ); … … 62 63 } 63 64 64 result = (*loc->handlers->rmnod)( &the_link ); 65 /* 66 * Now actually free the node we were asked to free. 67 */ 68 69 result = (*loc->handlers->rmnod)( loc ); 65 70 66 71 return result; -
c/src/lib/libc/Makefile.in
r6c85bdd r94b357c2 28 28 imfs_mount imfs_fchmod imfs_unlink imfs_unmount imfs_utime \ 29 29 imfs_ntype imfs_stat imfs_getchild memfile deviceio imfs_handlers_device \ 30 imfs_handlers_directory imfs_handlers_memfile imfs_debug imfs_symlink \ 31 imfs_readlink imfs_fdatasync imfs_fcntl miniimfs_init 30 imfs_handlers_directory imfs_handlers_link imfs_handlers_memfile \ 31 imfs_debug imfs_rmnod imfs_symlink imfs_readlink imfs_fdatasync \ 32 imfs_fcntl miniimfs_init 32 33 33 34 TERMIOS_C_PIECES = cfgetispeed cfgetospeed cfsetispeed cfsetospeed tcgetattr \ -
c/src/lib/libc/deviceio.c
r6c85bdd r94b357c2 213 213 * device_stat 214 214 * 215 * Th isIMFS_stat() is used.215 * The IMFS_stat() is used. 216 216 */ 217 217 218 218 /* 219 219 * device_rmnod 220 */ 221 222 int device_rmnod( 223 rtems_filesystem_location_info_t *pathloc /* IN */ 224 ) 225 { 226 IMFS_jnode_t *the_jnode; 227 228 the_jnode = (IMFS_jnode_t *) pathloc->node_access; 229 230 /* 231 * Take the node out of the parent's chain that contains this node 232 */ 233 234 if ( the_jnode->Parent != NULL ) { 235 Chain_Extract( (Chain_Node *) the_jnode ); 236 the_jnode->Parent = NULL; 237 } 238 239 /* 240 * Decrement the link counter and see if we can free the space. 241 */ 242 243 the_jnode->st_nlink--; 244 IMFS_update_ctime( the_jnode ); 245 246 /* 247 * The file cannot be open and the link must be less than 1 to free. 248 */ 249 250 if ( !rtems_libio_is_file_open( the_jnode ) && (the_jnode->st_nlink < 1) ) { 251 252 /* 253 * Is the rtems_filesystem_current is this node? 254 */ 255 256 if ( rtems_filesystem_current.node_access == pathloc->node_access ) 257 rtems_filesystem_current.node_access = NULL; 258 259 /* 260 * Free memory associated with a memory file. 261 */ 262 263 free( the_jnode ); 264 } 265 266 return 0; 267 268 } 269 270 271 220 * 221 * The IMFS_rmnod() is used. 222 */ -
c/src/lib/libc/imfs.h
r6c85bdd r94b357c2 213 213 */ 214 214 215 extern rtems_filesystem_file_handlers_r IMFS_directory_handlers; 215 216 extern rtems_filesystem_file_handlers_r IMFS_device_handlers; 217 extern rtems_filesystem_file_handlers_r IMFS_link_handlers; 216 218 extern rtems_filesystem_file_handlers_r IMFS_memfile_handlers; 217 extern rtems_filesystem_file_handlers_r IMFS_directory_handlers;218 219 extern rtems_filesystem_operations_table IMFS_ops; 219 220 extern rtems_filesystem_operations_table miniIMFS_ops; … … 457 458 ); 458 459 459 int device_rmnod(460 rtems_filesystem_location_info_t *pathloc /* IN */461 );462 463 460 int IMFS_utime( 464 461 rtems_filesystem_location_info_t *pathloc, /* IN */ … … 493 490 ); 494 491 492 int IMFS_rmnod( 493 rtems_filesystem_location_info_t *pathloc /* IN */ 494 ); 495 495 496 #ifdef __cplusplus 496 497 } -
c/src/lib/libc/imfs_eval.c
r6c85bdd r94b357c2 46 46 case IMFS_SYM_LINK: 47 47 case IMFS_HARD_LINK: 48 loc->handlers = & rtems_filesystem_null_handlers;48 loc->handlers = &IMFS_link_handlers; 49 49 break; 50 50 case IMFS_MEMORY_FILE: -
c/src/lib/libc/imfs_fsunmount.c
r6c85bdd r94b357c2 43 43 ((IMFS_jnode_t *)( Chain_Head( jnode_get_control( jnode ) )->next)) 44 44 45 /* XXX should be in a more public place */ 46 47 extern int IMFS_Set_handlers( 48 rtems_filesystem_location_info_t *loc 49 ); 45 50 46 51 int IMFS_fsunmount( … … 60 65 jnode = (IMFS_jnode_t *)temp_mt_entry->mt_fs_root.node_access; 61 66 loc = temp_mt_entry->mt_fs_root; 62 63 67 64 68 /* … … 71 75 next = jnode->Parent; 72 76 loc.node_access = (void *)jnode; 77 IMFS_Set_handlers( &loc ); 73 78 74 79 if ( jnode->type != IMFS_DIRECTORY ) { -
c/src/lib/libc/imfs_handlers_device.c
r6c85bdd r94b357c2 35 35 NULL, /* fdatasync */ 36 36 NULL, /* fcntl */ 37 device_rmnod37 IMFS_rmnod 38 38 }; -
c/src/lib/libc/imfs_unlink.c
r6c85bdd r94b357c2 50 50 51 51 /* 52 * If this is the last referance to the node53 * Free the node that the link points to.52 * If removing the last hard link to a node, then we need 53 * to remove the node that is a link and the node itself. 54 54 */ 55 55 56 node->info.hard_link.link_node->st_nlink --; 56 57 IMFS_update_ctime( node->info.hard_link.link_node ); … … 62 63 } 63 64 64 result = (*loc->handlers->rmnod)( &the_link ); 65 /* 66 * Now actually free the node we were asked to free. 67 */ 68 69 result = (*loc->handlers->rmnod)( loc ); 65 70 66 71 return result; -
c/src/libfs/src/imfs/deviceio.c
r6c85bdd r94b357c2 213 213 * device_stat 214 214 * 215 * Th isIMFS_stat() is used.215 * The IMFS_stat() is used. 216 216 */ 217 217 218 218 /* 219 219 * device_rmnod 220 */ 221 222 int device_rmnod( 223 rtems_filesystem_location_info_t *pathloc /* IN */ 224 ) 225 { 226 IMFS_jnode_t *the_jnode; 227 228 the_jnode = (IMFS_jnode_t *) pathloc->node_access; 229 230 /* 231 * Take the node out of the parent's chain that contains this node 232 */ 233 234 if ( the_jnode->Parent != NULL ) { 235 Chain_Extract( (Chain_Node *) the_jnode ); 236 the_jnode->Parent = NULL; 237 } 238 239 /* 240 * Decrement the link counter and see if we can free the space. 241 */ 242 243 the_jnode->st_nlink--; 244 IMFS_update_ctime( the_jnode ); 245 246 /* 247 * The file cannot be open and the link must be less than 1 to free. 248 */ 249 250 if ( !rtems_libio_is_file_open( the_jnode ) && (the_jnode->st_nlink < 1) ) { 251 252 /* 253 * Is the rtems_filesystem_current is this node? 254 */ 255 256 if ( rtems_filesystem_current.node_access == pathloc->node_access ) 257 rtems_filesystem_current.node_access = NULL; 258 259 /* 260 * Free memory associated with a memory file. 261 */ 262 263 free( the_jnode ); 264 } 265 266 return 0; 267 268 } 269 270 271 220 * 221 * The IMFS_rmnod() is used. 222 */ -
c/src/libfs/src/imfs/imfs.h
r6c85bdd r94b357c2 213 213 */ 214 214 215 extern rtems_filesystem_file_handlers_r IMFS_directory_handlers; 215 216 extern rtems_filesystem_file_handlers_r IMFS_device_handlers; 217 extern rtems_filesystem_file_handlers_r IMFS_link_handlers; 216 218 extern rtems_filesystem_file_handlers_r IMFS_memfile_handlers; 217 extern rtems_filesystem_file_handlers_r IMFS_directory_handlers;218 219 extern rtems_filesystem_operations_table IMFS_ops; 219 220 extern rtems_filesystem_operations_table miniIMFS_ops; … … 457 458 ); 458 459 459 int device_rmnod(460 rtems_filesystem_location_info_t *pathloc /* IN */461 );462 463 460 int IMFS_utime( 464 461 rtems_filesystem_location_info_t *pathloc, /* IN */ … … 493 490 ); 494 491 492 int IMFS_rmnod( 493 rtems_filesystem_location_info_t *pathloc /* IN */ 494 ); 495 495 496 #ifdef __cplusplus 496 497 } -
c/src/libfs/src/imfs/imfs_eval.c
r6c85bdd r94b357c2 46 46 case IMFS_SYM_LINK: 47 47 case IMFS_HARD_LINK: 48 loc->handlers = & rtems_filesystem_null_handlers;48 loc->handlers = &IMFS_link_handlers; 49 49 break; 50 50 case IMFS_MEMORY_FILE: -
c/src/libfs/src/imfs/imfs_fsunmount.c
r6c85bdd r94b357c2 43 43 ((IMFS_jnode_t *)( Chain_Head( jnode_get_control( jnode ) )->next)) 44 44 45 /* XXX should be in a more public place */ 46 47 extern int IMFS_Set_handlers( 48 rtems_filesystem_location_info_t *loc 49 ); 45 50 46 51 int IMFS_fsunmount( … … 60 65 jnode = (IMFS_jnode_t *)temp_mt_entry->mt_fs_root.node_access; 61 66 loc = temp_mt_entry->mt_fs_root; 62 63 67 64 68 /* … … 71 75 next = jnode->Parent; 72 76 loc.node_access = (void *)jnode; 77 IMFS_Set_handlers( &loc ); 73 78 74 79 if ( jnode->type != IMFS_DIRECTORY ) { -
c/src/libfs/src/imfs/imfs_handlers_device.c
r6c85bdd r94b357c2 35 35 NULL, /* fdatasync */ 36 36 NULL, /* fcntl */ 37 device_rmnod37 IMFS_rmnod 38 38 }; -
c/src/libfs/src/imfs/imfs_unlink.c
r6c85bdd r94b357c2 50 50 51 51 /* 52 * If this is the last referance to the node53 * Free the node that the link points to.52 * If removing the last hard link to a node, then we need 53 * to remove the node that is a link and the node itself. 54 54 */ 55 55 56 node->info.hard_link.link_node->st_nlink --; 56 57 IMFS_update_ctime( node->info.hard_link.link_node ); … … 62 63 } 63 64 64 result = (*loc->handlers->rmnod)( &the_link ); 65 /* 66 * Now actually free the node we were asked to free. 67 */ 68 69 result = (*loc->handlers->rmnod)( loc ); 65 70 66 71 return result; -
cpukit/libfs/src/imfs/deviceio.c
r6c85bdd r94b357c2 213 213 * device_stat 214 214 * 215 * Th isIMFS_stat() is used.215 * The IMFS_stat() is used. 216 216 */ 217 217 218 218 /* 219 219 * device_rmnod 220 */ 221 222 int device_rmnod( 223 rtems_filesystem_location_info_t *pathloc /* IN */ 224 ) 225 { 226 IMFS_jnode_t *the_jnode; 227 228 the_jnode = (IMFS_jnode_t *) pathloc->node_access; 229 230 /* 231 * Take the node out of the parent's chain that contains this node 232 */ 233 234 if ( the_jnode->Parent != NULL ) { 235 Chain_Extract( (Chain_Node *) the_jnode ); 236 the_jnode->Parent = NULL; 237 } 238 239 /* 240 * Decrement the link counter and see if we can free the space. 241 */ 242 243 the_jnode->st_nlink--; 244 IMFS_update_ctime( the_jnode ); 245 246 /* 247 * The file cannot be open and the link must be less than 1 to free. 248 */ 249 250 if ( !rtems_libio_is_file_open( the_jnode ) && (the_jnode->st_nlink < 1) ) { 251 252 /* 253 * Is the rtems_filesystem_current is this node? 254 */ 255 256 if ( rtems_filesystem_current.node_access == pathloc->node_access ) 257 rtems_filesystem_current.node_access = NULL; 258 259 /* 260 * Free memory associated with a memory file. 261 */ 262 263 free( the_jnode ); 264 } 265 266 return 0; 267 268 } 269 270 271 220 * 221 * The IMFS_rmnod() is used. 222 */ -
cpukit/libfs/src/imfs/imfs.h
r6c85bdd r94b357c2 213 213 */ 214 214 215 extern rtems_filesystem_file_handlers_r IMFS_directory_handlers; 215 216 extern rtems_filesystem_file_handlers_r IMFS_device_handlers; 217 extern rtems_filesystem_file_handlers_r IMFS_link_handlers; 216 218 extern rtems_filesystem_file_handlers_r IMFS_memfile_handlers; 217 extern rtems_filesystem_file_handlers_r IMFS_directory_handlers;218 219 extern rtems_filesystem_operations_table IMFS_ops; 219 220 extern rtems_filesystem_operations_table miniIMFS_ops; … … 457 458 ); 458 459 459 int device_rmnod(460 rtems_filesystem_location_info_t *pathloc /* IN */461 );462 463 460 int IMFS_utime( 464 461 rtems_filesystem_location_info_t *pathloc, /* IN */ … … 493 490 ); 494 491 492 int IMFS_rmnod( 493 rtems_filesystem_location_info_t *pathloc /* IN */ 494 ); 495 495 496 #ifdef __cplusplus 496 497 } -
cpukit/libfs/src/imfs/imfs_eval.c
r6c85bdd r94b357c2 46 46 case IMFS_SYM_LINK: 47 47 case IMFS_HARD_LINK: 48 loc->handlers = & rtems_filesystem_null_handlers;48 loc->handlers = &IMFS_link_handlers; 49 49 break; 50 50 case IMFS_MEMORY_FILE: -
cpukit/libfs/src/imfs/imfs_fsunmount.c
r6c85bdd r94b357c2 43 43 ((IMFS_jnode_t *)( Chain_Head( jnode_get_control( jnode ) )->next)) 44 44 45 /* XXX should be in a more public place */ 46 47 extern int IMFS_Set_handlers( 48 rtems_filesystem_location_info_t *loc 49 ); 45 50 46 51 int IMFS_fsunmount( … … 60 65 jnode = (IMFS_jnode_t *)temp_mt_entry->mt_fs_root.node_access; 61 66 loc = temp_mt_entry->mt_fs_root; 62 63 67 64 68 /* … … 71 75 next = jnode->Parent; 72 76 loc.node_access = (void *)jnode; 77 IMFS_Set_handlers( &loc ); 73 78 74 79 if ( jnode->type != IMFS_DIRECTORY ) { -
cpukit/libfs/src/imfs/imfs_handlers_device.c
r6c85bdd r94b357c2 35 35 NULL, /* fdatasync */ 36 36 NULL, /* fcntl */ 37 device_rmnod37 IMFS_rmnod 38 38 }; -
cpukit/libfs/src/imfs/imfs_unlink.c
r6c85bdd r94b357c2 50 50 51 51 /* 52 * If this is the last referance to the node53 * Free the node that the link points to.52 * If removing the last hard link to a node, then we need 53 * to remove the node that is a link and the node itself. 54 54 */ 55 55 56 node->info.hard_link.link_node->st_nlink --; 56 57 IMFS_update_ctime( node->info.hard_link.link_node ); … … 62 63 } 63 64 64 result = (*loc->handlers->rmnod)( &the_link ); 65 /* 66 * Now actually free the node we were asked to free. 67 */ 68 69 result = (*loc->handlers->rmnod)( loc ); 65 70 66 71 return result;
Note: See TracChangeset
for help on using the changeset viewer.