Changeset 04df848 in rtems
- Timestamp:
- 10/25/99 14:23:03 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 1e57186
- Parents:
- 72d3f610
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/libcsupport/src/mount.c
r72d3f610 r04df848 96 96 rtems_filesystem_location_info_t loc; 97 97 rtems_filesystem_mount_table_entry_t *temp_mt_entry; 98 rtems_filesystem_location_info_t *loc_to_free = NULL; 98 99 99 100 /* XXX add code to check for required operations */ … … 142 143 143 144 if ( mount_point ) { 144 if ( rtems_filesystem_evaluate_path( 145 mount_point, 146 RTEMS_LIBIO_PERMS_RWX, 147 &loc, 148 TRUE ) == -1 ) 149 goto cleanup_and_bail; 150 151 /* 152 * Test to see if it is a directory 153 */ 154 155 if ( loc.ops->node_type( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 156 errno = ENOTDIR; 157 goto cleanup_and_bail; 158 } 159 160 /* 161 * You can only mount one file system onto a single mount point. 162 */ 163 164 if ( search_mt_for_mount_point( &loc ) == FOUND ) { 165 errno = EBUSY; 166 goto cleanup_and_bail; 167 } 145 146 if ( rtems_filesystem_evaluate_path( 147 mount_point, RTEMS_LIBIO_PERMS_RWX, &loc, TRUE ) == -1 ) 148 goto cleanup_and_bail; 149 150 /* 151 * Test to see if it is a directory 152 */ 153 154 loc_to_free = &loc; 155 if ( loc.ops->node_type( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 156 errno = ENOTDIR; 157 goto cleanup_and_bail; 158 } 159 160 /* 161 * You can only mount one file system onto a single mount point. 162 */ 163 164 if ( search_mt_for_mount_point( &loc ) == FOUND ) { 165 errno = EBUSY; 166 goto cleanup_and_bail; 167 } 168 168 169 /* 170 * This must be a good mount point, so move the location information 171 * into the allocated mount entry 172 */ 173 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; 178 179 /* 180 * This link to the parent is only done when we are dealing with system 181 * below the base file system 182 */ 183 184 if ( !loc.ops->mount ){ 185 errno = ENOTSUP; 186 goto cleanup_and_bail; 187 } 188 189 if ( loc.ops->mount( temp_mt_entry ) ) { 190 goto cleanup_and_bail; 191 } 192 } 193 else { 194 195 /* 196 * This is a mount of the base file system --> The 197 * mt_point_node.node_access will be set to null to indicate that this 198 * is the root of the entire file system. 199 */ 200 201 temp_mt_entry->mt_fs_root.node_access = NULL; 202 temp_mt_entry->mt_fs_root.handlers = NULL; 203 temp_mt_entry->mt_fs_root.ops = NULL; 204 205 temp_mt_entry->mt_point_node.node_access = NULL; 206 temp_mt_entry->mt_point_node.handlers = NULL; 207 temp_mt_entry->mt_point_node.ops = NULL; 208 temp_mt_entry->mt_point_node.mt_entry = NULL; 169 /* 170 * This must be a good mount point, so move the location information 171 * into the allocated mount entry. Note: the information that 172 * may have been allocated in loc should not be sent to freenode 173 * until the system is unmounted. It may be needed to correctly 174 * traverse the tree. 175 */ 176 177 temp_mt_entry->mt_point_node.node_access = loc.node_access; 178 temp_mt_entry->mt_point_node.handlers = loc.handlers; 179 temp_mt_entry->mt_point_node.ops = loc.ops; 180 temp_mt_entry->mt_point_node.mt_entry = loc.mt_entry; 181 182 /* 183 * This link to the parent is only done when we are dealing with system 184 * below the base file system 185 */ 186 187 if ( !loc.ops->mount ){ 188 errno = ENOTSUP; 189 goto cleanup_and_bail; 190 } 191 192 if ( loc.ops->mount( temp_mt_entry ) ) { 193 goto cleanup_and_bail; 194 } 195 } else { 196 197 /* 198 * This is a mount of the base file system --> The 199 * mt_point_node.node_access will be set to null to indicate that this 200 * is the root of the entire file system. 201 */ 202 203 temp_mt_entry->mt_fs_root.node_access = NULL; 204 temp_mt_entry->mt_fs_root.handlers = NULL; 205 temp_mt_entry->mt_fs_root.ops = NULL; 206 207 temp_mt_entry->mt_point_node.node_access = NULL; 208 temp_mt_entry->mt_point_node.handlers = NULL; 209 temp_mt_entry->mt_point_node.ops = NULL; 210 temp_mt_entry->mt_point_node.mt_entry = NULL; 209 211 } 210 212 211 213 if ( !fs_ops->fsmount_me ){ 212 213 214 errno = ENOTSUP; 215 goto cleanup_and_bail; 214 216 } 215 217 216 218 if ( fs_ops->fsmount_me( temp_mt_entry ) ) 217 218 219 /* 220 * Add the mount table entry to the mount table chain219 goto cleanup_and_bail; 220 221 /* 222 * Add the mount table entry to the mount table chain 221 223 */ 222 224 … … 225 227 *mt_entry = temp_mt_entry; 226 228 227 rtems_filesystem_freenode( &loc ); 229 return 0; 230 231 cleanup_and_bail: 232 233 free( temp_mt_entry ); 228 234 229 return 0; 230 231 cleanup_and_bail: 232 233 free( temp_mt_entry ); 234 235 rtems_filesystem_freenode( &loc ); 236 235 if ( loc_to_free ) 236 rtems_filesystem_freenode( loc_to_free ); 237 237 238 return -1; 238 239 } -
c/src/exec/libcsupport/src/unmount.c
r72d3f610 r04df848 138 138 */ 139 139 140 rtems_filesystem_freenode( &temp_loc.mt_entry->mt_point_node ); 140 141 free( temp_loc.mt_entry ); 141 142 rtems_filesystem_freenode( &temp_loc ); -
c/src/lib/libc/mount.c
r72d3f610 r04df848 96 96 rtems_filesystem_location_info_t loc; 97 97 rtems_filesystem_mount_table_entry_t *temp_mt_entry; 98 rtems_filesystem_location_info_t *loc_to_free = NULL; 98 99 99 100 /* XXX add code to check for required operations */ … … 142 143 143 144 if ( mount_point ) { 144 if ( rtems_filesystem_evaluate_path( 145 mount_point, 146 RTEMS_LIBIO_PERMS_RWX, 147 &loc, 148 TRUE ) == -1 ) 149 goto cleanup_and_bail; 150 151 /* 152 * Test to see if it is a directory 153 */ 154 155 if ( loc.ops->node_type( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 156 errno = ENOTDIR; 157 goto cleanup_and_bail; 158 } 159 160 /* 161 * You can only mount one file system onto a single mount point. 162 */ 163 164 if ( search_mt_for_mount_point( &loc ) == FOUND ) { 165 errno = EBUSY; 166 goto cleanup_and_bail; 167 } 145 146 if ( rtems_filesystem_evaluate_path( 147 mount_point, RTEMS_LIBIO_PERMS_RWX, &loc, TRUE ) == -1 ) 148 goto cleanup_and_bail; 149 150 /* 151 * Test to see if it is a directory 152 */ 153 154 loc_to_free = &loc; 155 if ( loc.ops->node_type( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 156 errno = ENOTDIR; 157 goto cleanup_and_bail; 158 } 159 160 /* 161 * You can only mount one file system onto a single mount point. 162 */ 163 164 if ( search_mt_for_mount_point( &loc ) == FOUND ) { 165 errno = EBUSY; 166 goto cleanup_and_bail; 167 } 168 168 169 /* 170 * This must be a good mount point, so move the location information 171 * into the allocated mount entry 172 */ 173 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; 178 179 /* 180 * This link to the parent is only done when we are dealing with system 181 * below the base file system 182 */ 183 184 if ( !loc.ops->mount ){ 185 errno = ENOTSUP; 186 goto cleanup_and_bail; 187 } 188 189 if ( loc.ops->mount( temp_mt_entry ) ) { 190 goto cleanup_and_bail; 191 } 192 } 193 else { 194 195 /* 196 * This is a mount of the base file system --> The 197 * mt_point_node.node_access will be set to null to indicate that this 198 * is the root of the entire file system. 199 */ 200 201 temp_mt_entry->mt_fs_root.node_access = NULL; 202 temp_mt_entry->mt_fs_root.handlers = NULL; 203 temp_mt_entry->mt_fs_root.ops = NULL; 204 205 temp_mt_entry->mt_point_node.node_access = NULL; 206 temp_mt_entry->mt_point_node.handlers = NULL; 207 temp_mt_entry->mt_point_node.ops = NULL; 208 temp_mt_entry->mt_point_node.mt_entry = NULL; 169 /* 170 * This must be a good mount point, so move the location information 171 * into the allocated mount entry. Note: the information that 172 * may have been allocated in loc should not be sent to freenode 173 * until the system is unmounted. It may be needed to correctly 174 * traverse the tree. 175 */ 176 177 temp_mt_entry->mt_point_node.node_access = loc.node_access; 178 temp_mt_entry->mt_point_node.handlers = loc.handlers; 179 temp_mt_entry->mt_point_node.ops = loc.ops; 180 temp_mt_entry->mt_point_node.mt_entry = loc.mt_entry; 181 182 /* 183 * This link to the parent is only done when we are dealing with system 184 * below the base file system 185 */ 186 187 if ( !loc.ops->mount ){ 188 errno = ENOTSUP; 189 goto cleanup_and_bail; 190 } 191 192 if ( loc.ops->mount( temp_mt_entry ) ) { 193 goto cleanup_and_bail; 194 } 195 } else { 196 197 /* 198 * This is a mount of the base file system --> The 199 * mt_point_node.node_access will be set to null to indicate that this 200 * is the root of the entire file system. 201 */ 202 203 temp_mt_entry->mt_fs_root.node_access = NULL; 204 temp_mt_entry->mt_fs_root.handlers = NULL; 205 temp_mt_entry->mt_fs_root.ops = NULL; 206 207 temp_mt_entry->mt_point_node.node_access = NULL; 208 temp_mt_entry->mt_point_node.handlers = NULL; 209 temp_mt_entry->mt_point_node.ops = NULL; 210 temp_mt_entry->mt_point_node.mt_entry = NULL; 209 211 } 210 212 211 213 if ( !fs_ops->fsmount_me ){ 212 213 214 errno = ENOTSUP; 215 goto cleanup_and_bail; 214 216 } 215 217 216 218 if ( fs_ops->fsmount_me( temp_mt_entry ) ) 217 218 219 /* 220 * Add the mount table entry to the mount table chain219 goto cleanup_and_bail; 220 221 /* 222 * Add the mount table entry to the mount table chain 221 223 */ 222 224 … … 225 227 *mt_entry = temp_mt_entry; 226 228 227 rtems_filesystem_freenode( &loc ); 229 return 0; 230 231 cleanup_and_bail: 232 233 free( temp_mt_entry ); 228 234 229 return 0; 230 231 cleanup_and_bail: 232 233 free( temp_mt_entry ); 234 235 rtems_filesystem_freenode( &loc ); 236 235 if ( loc_to_free ) 236 rtems_filesystem_freenode( loc_to_free ); 237 237 238 return -1; 238 239 } -
c/src/lib/libc/unmount.c
r72d3f610 r04df848 138 138 */ 139 139 140 rtems_filesystem_freenode( &temp_loc.mt_entry->mt_point_node ); 140 141 free( temp_loc.mt_entry ); 141 142 rtems_filesystem_freenode( &temp_loc ); -
cpukit/libcsupport/src/mount.c
r72d3f610 r04df848 96 96 rtems_filesystem_location_info_t loc; 97 97 rtems_filesystem_mount_table_entry_t *temp_mt_entry; 98 rtems_filesystem_location_info_t *loc_to_free = NULL; 98 99 99 100 /* XXX add code to check for required operations */ … … 142 143 143 144 if ( mount_point ) { 144 if ( rtems_filesystem_evaluate_path( 145 mount_point, 146 RTEMS_LIBIO_PERMS_RWX, 147 &loc, 148 TRUE ) == -1 ) 149 goto cleanup_and_bail; 150 151 /* 152 * Test to see if it is a directory 153 */ 154 155 if ( loc.ops->node_type( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 156 errno = ENOTDIR; 157 goto cleanup_and_bail; 158 } 159 160 /* 161 * You can only mount one file system onto a single mount point. 162 */ 163 164 if ( search_mt_for_mount_point( &loc ) == FOUND ) { 165 errno = EBUSY; 166 goto cleanup_and_bail; 167 } 145 146 if ( rtems_filesystem_evaluate_path( 147 mount_point, RTEMS_LIBIO_PERMS_RWX, &loc, TRUE ) == -1 ) 148 goto cleanup_and_bail; 149 150 /* 151 * Test to see if it is a directory 152 */ 153 154 loc_to_free = &loc; 155 if ( loc.ops->node_type( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { 156 errno = ENOTDIR; 157 goto cleanup_and_bail; 158 } 159 160 /* 161 * You can only mount one file system onto a single mount point. 162 */ 163 164 if ( search_mt_for_mount_point( &loc ) == FOUND ) { 165 errno = EBUSY; 166 goto cleanup_and_bail; 167 } 168 168 169 /* 170 * This must be a good mount point, so move the location information 171 * into the allocated mount entry 172 */ 173 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; 178 179 /* 180 * This link to the parent is only done when we are dealing with system 181 * below the base file system 182 */ 183 184 if ( !loc.ops->mount ){ 185 errno = ENOTSUP; 186 goto cleanup_and_bail; 187 } 188 189 if ( loc.ops->mount( temp_mt_entry ) ) { 190 goto cleanup_and_bail; 191 } 192 } 193 else { 194 195 /* 196 * This is a mount of the base file system --> The 197 * mt_point_node.node_access will be set to null to indicate that this 198 * is the root of the entire file system. 199 */ 200 201 temp_mt_entry->mt_fs_root.node_access = NULL; 202 temp_mt_entry->mt_fs_root.handlers = NULL; 203 temp_mt_entry->mt_fs_root.ops = NULL; 204 205 temp_mt_entry->mt_point_node.node_access = NULL; 206 temp_mt_entry->mt_point_node.handlers = NULL; 207 temp_mt_entry->mt_point_node.ops = NULL; 208 temp_mt_entry->mt_point_node.mt_entry = NULL; 169 /* 170 * This must be a good mount point, so move the location information 171 * into the allocated mount entry. Note: the information that 172 * may have been allocated in loc should not be sent to freenode 173 * until the system is unmounted. It may be needed to correctly 174 * traverse the tree. 175 */ 176 177 temp_mt_entry->mt_point_node.node_access = loc.node_access; 178 temp_mt_entry->mt_point_node.handlers = loc.handlers; 179 temp_mt_entry->mt_point_node.ops = loc.ops; 180 temp_mt_entry->mt_point_node.mt_entry = loc.mt_entry; 181 182 /* 183 * This link to the parent is only done when we are dealing with system 184 * below the base file system 185 */ 186 187 if ( !loc.ops->mount ){ 188 errno = ENOTSUP; 189 goto cleanup_and_bail; 190 } 191 192 if ( loc.ops->mount( temp_mt_entry ) ) { 193 goto cleanup_and_bail; 194 } 195 } else { 196 197 /* 198 * This is a mount of the base file system --> The 199 * mt_point_node.node_access will be set to null to indicate that this 200 * is the root of the entire file system. 201 */ 202 203 temp_mt_entry->mt_fs_root.node_access = NULL; 204 temp_mt_entry->mt_fs_root.handlers = NULL; 205 temp_mt_entry->mt_fs_root.ops = NULL; 206 207 temp_mt_entry->mt_point_node.node_access = NULL; 208 temp_mt_entry->mt_point_node.handlers = NULL; 209 temp_mt_entry->mt_point_node.ops = NULL; 210 temp_mt_entry->mt_point_node.mt_entry = NULL; 209 211 } 210 212 211 213 if ( !fs_ops->fsmount_me ){ 212 213 214 errno = ENOTSUP; 215 goto cleanup_and_bail; 214 216 } 215 217 216 218 if ( fs_ops->fsmount_me( temp_mt_entry ) ) 217 218 219 /* 220 * Add the mount table entry to the mount table chain219 goto cleanup_and_bail; 220 221 /* 222 * Add the mount table entry to the mount table chain 221 223 */ 222 224 … … 225 227 *mt_entry = temp_mt_entry; 226 228 227 rtems_filesystem_freenode( &loc ); 229 return 0; 230 231 cleanup_and_bail: 232 233 free( temp_mt_entry ); 228 234 229 return 0; 230 231 cleanup_and_bail: 232 233 free( temp_mt_entry ); 234 235 rtems_filesystem_freenode( &loc ); 236 235 if ( loc_to_free ) 236 rtems_filesystem_freenode( loc_to_free ); 237 237 238 return -1; 238 239 } -
cpukit/libcsupport/src/unmount.c
r72d3f610 r04df848 138 138 */ 139 139 140 rtems_filesystem_freenode( &temp_loc.mt_entry->mt_point_node ); 140 141 free( temp_loc.mt_entry ); 141 142 rtems_filesystem_freenode( &temp_loc );
Note: See TracChangeset
for help on using the changeset viewer.