Changeset 492 for trunk/kernel/fs
- Timestamp:
- Aug 22, 2018, 11:55:48 PM (6 years ago)
- Location:
- trunk/kernel/fs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/fs/devfs.c
r484 r492 108 108 devfs_dev_inode_xp ); 109 109 110 assert( (error == 0) , __FUNCTION__ ,"cannot create <dev>\n" );110 assert( (error == 0) , "cannot create <dev>\n" ); 111 111 112 112 #if( DEBUG_DEVFS_INIT & 1 ) … … 124 124 devfs_external_inode_xp ); 125 125 126 assert( (error == 0) , __FUNCTION__ ,"cannot create <external>\n" );126 assert( (error == 0) , "cannot create <external>\n" ); 127 127 128 128 #if DEBUG_DEVFS_INIT … … 372 372 uint32_t size ) 373 373 { 374 assert( ( file_xp != XPTR_NULL ) , __FUNCTION__ ,"file_xp == XPTR_NULL" );375 376 assert( ( size < CONFIG_TXT_KBUF_SIZE ) , __FUNCTION__ ,"string size too large" );374 assert( ( file_xp != XPTR_NULL ) , "file_xp == XPTR_NULL" ); 375 376 assert( ( size < CONFIG_TXT_KBUF_SIZE ) , "string size too large" ); 377 377 378 378 xptr_t chdev_xp; … … 471 471 else 472 472 { 473 assert( false , __FUNCTION__ ,473 assert( false , 474 474 "%s does not support direct user access", chdev_func_str(func) ); 475 475 -
trunk/kernel/fs/fatfs.c
r484 r492 259 259 uint32_t next_cluster_id; // content of current FAT slot 260 260 261 assert( (searched_page_index > 0) , __FUNCTION__ ,261 assert( (searched_page_index > 0) , 262 262 "no FAT access required for first page\n"); 263 263 … … 352 352 #endif 353 353 354 assert( (fatfs_ctx != NULL) , __FUNCTION__ ,354 assert( (fatfs_ctx != NULL) , 355 355 "cannot allocate memory for FATFS context\n" ); 356 356 … … 360 360 buffer = (uint8_t *)kmem_alloc( &req ); 361 361 362 assert( (buffer != NULL) , __FUNCTION__ ,362 assert( (buffer != NULL) , 363 363 "cannot allocate memory for 512 bytes buffer\n" ); 364 364 … … 367 367 error = dev_ioc_sync_read( buffer , 0 , 1 ); 368 368 369 assert( (error == 0) , __FUNCTION__ ,369 assert( (error == 0) , 370 370 "cannot access boot record\n" ); 371 371 … … 393 393 uint32_t sector_size = fatfs_get_record( BPB_BYTSPERSEC , buffer , 1 ); 394 394 395 assert( (sector_size == 512) , __FUNCTION__ ,395 assert( (sector_size == 512) , 396 396 "sector size must be 512 bytes\n" ); 397 397 … … 399 399 uint32_t nb_sectors = fatfs_get_record( BPB_SECPERCLUS , buffer , 1 ); 400 400 401 assert( (nb_sectors == 8) , __FUNCTION__ ,401 assert( (nb_sectors == 8) , 402 402 "cluster size must be 8 sectors\n" ); 403 403 … … 405 405 uint32_t nb_fats = fatfs_get_record( BPB_NUMFATS , buffer , 1 ); 406 406 407 assert( (nb_fats == 1) , __FUNCTION__ ,407 assert( (nb_fats == 1) , 408 408 "number of FAT copies must be 1\n" ); 409 409 … … 411 411 uint32_t fat_sectors = fatfs_get_record( BPB_FAT32_FATSZ32 , buffer , 1 ); 412 412 413 assert( ((fat_sectors & 0xF) == 0) , __FUNCTION__ ,413 assert( ((fat_sectors & 0xF) == 0) , 414 414 "FAT not multiple of 16 sectors\n"); 415 415 … … 417 417 uint32_t root_cluster = fatfs_get_record( BPB_FAT32_ROOTCLUS , buffer , 1 ); 418 418 419 assert( (root_cluster == 2) , __FUNCTION__ ,419 assert( (root_cluster == 2) , 420 420 "root cluster index must be 2\n"); 421 421 … … 431 431 mapper_t * fat_mapper = mapper_create( FS_TYPE_FATFS ); 432 432 433 assert( (fat_mapper != NULL) , __FUNCTION__ ,433 assert( (fat_mapper != NULL) , 434 434 "no memory for FAT mapper" ); 435 435 … … 632 632 mapper_t * mapper = parent_inode->mapper; 633 633 634 assert( (mapper != NULL) , __FUNCTION__ ,"parent mapper undefined\n");634 assert( (mapper != NULL) , "parent mapper undefined\n"); 635 635 636 636 char cname[CONFIG_VFS_MAX_NAME_LENGTH]; // name extracter from each directory entry … … 659 659 page = mapper_get_page( mapper , index ); 660 660 661 assert( (page != NULL) , __FUNCTION__ ,"bad parent mapper\n");661 assert( (page != NULL) , "bad parent mapper\n"); 662 662 663 663 // get page base -
trunk/kernel/fs/vfs.c
r484 r492 171 171 { 172 172 ctx = NULL; 173 assert( false , __FUNCTION__ ,"illegal file system type = %d\n" , fs_type );173 assert( false , "illegal file system type = %d\n" , fs_type ); 174 174 } 175 175 … … 250 250 error_t vfs_inode_destroy( vfs_inode_t * inode ) 251 251 { 252 assert( (inode->refcount == 0) , __FUNCTION__, "inode refcount non zero\n" );252 assert( (inode->refcount == 0) , "inode refcount non zero\n" ); 253 253 254 254 // release memory allocated for mapper … … 280 280 error_t error = 0; 281 281 282 assert( (parent != NULL) , __FUNCTION__ ,"parent pointer is NULL\n");283 284 assert( (child_xp != XPTR_NULL) , __FUNCTION__ ,"child pointer is NULL\n");282 assert( (parent != NULL) , "parent pointer is NULL\n"); 283 284 assert( (child_xp != XPTR_NULL) , "child pointer is NULL\n"); 285 285 286 286 // get parent inode FS type … … 294 294 else if( fs_type == FS_TYPE_RAMFS ) 295 295 { 296 assert( false , __FUNCTION__ ,"should not be called for RAMFS\n" );296 assert( false , "should not be called for RAMFS\n" ); 297 297 } 298 298 else if( fs_type == FS_TYPE_DEVFS ) 299 299 { 300 assert( false , __FUNCTION__ ,"should not be called for DEVFS\n" );300 assert( false , "should not be called for DEVFS\n" ); 301 301 } 302 302 else 303 303 { 304 assert( false , __FUNCTION__ ,"undefined file system type\n" );304 assert( false , "undefined file system type\n" ); 305 305 } 306 306 … … 581 581 if( file->refcount ) 582 582 { 583 assert( false , __FUNCTION__ ,"refcount non zero\n" );583 assert( false , "refcount non zero\n" ); 584 584 } 585 585 … … 713 713 uint32_t size ) 714 714 { 715 assert( ( file_xp != XPTR_NULL ) , __FUNCTION__ ,"file_xp == XPTR_NULL" );715 assert( ( file_xp != XPTR_NULL ) , "file_xp == XPTR_NULL" ); 716 716 717 717 cxy_t file_cxy; // remote file descriptor cluster … … 729 729 inode_type = hal_remote_lw( XPTR( file_cxy , &file_ptr->type ) ); 730 730 731 assert( (inode_type == INODE_TYPE_FILE) , __FUNCTION__ ,731 assert( (inode_type == INODE_TYPE_FILE) , 732 732 "inode type is not INODE_TYPE_FILE" ); 733 733 … … 768 768 uint32_t size ) 769 769 { 770 assert( ( file_xp != XPTR_NULL ) , __FUNCTION__ ,"file_xp == XPTR_NULL" );770 assert( ( file_xp != XPTR_NULL ) , "file_xp == XPTR_NULL" ); 771 771 772 772 cxy_t file_cxy; // remote file descriptor cluster … … 835 835 uint32_t new; 836 836 837 assert( (file_xp != XPTR_NULL) , __FUNCTION__ ,"file_xp == XPTR_NULL" );837 assert( (file_xp != XPTR_NULL) , "file_xp == XPTR_NULL" ); 838 838 839 839 // get cluster and local pointer on remote file descriptor … … 899 899 process_t * process_ptr; // process copy local pointer 900 900 901 assert( (file_xp != XPTR_NULL) , __FUNCTION__ ,"file_xp == XPTR_NULL" );902 903 assert( (file_id < CONFIG_PROCESS_FILE_MAX_NR) , __FUNCTION__ ,"illegal file_id" );901 assert( (file_xp != XPTR_NULL) , "file_xp == XPTR_NULL" ); 902 903 assert( (file_id < CONFIG_PROCESS_FILE_MAX_NR) , "illegal file_id" ); 904 904 905 905 thread_t * this = CURRENT_THREAD; … … 996 996 char * path ) 997 997 { 998 assert( false , __FUNCTION__ , "not implemented\n", cwd_xp, path ); 998 assert( false , "not implemented cwd_xp %x, path <%s> \n", 999 cwd_xp, path ); 999 1000 return 0; 1000 1001 } … … 1004 1005 struct stat * k_stat ) 1005 1006 { 1006 assert( false , __FUNCTION__ , "not implemented\n", file_xp, k_stat ); 1007 assert( false , "not implemented file_xp: %x, k_stat ptr %x\n", 1008 file_xp, k_stat ); 1007 1009 return 0; 1008 1010 } … … 1012 1014 struct dirent * k_dirent ) 1013 1015 { 1014 assert( false , __FUNCTION__ , "not implemented\n", file_xp, k_dirent ); 1016 assert( false , "not implemented file_xp: %x, k_dirent ptr %x\n", 1017 file_xp, k_dirent ); 1015 1018 return 0; 1016 1019 } … … 1021 1024 uint32_t mode ) 1022 1025 { 1023 assert( false , __FUNCTION__ , "not implemented\n", file_xp, path, mode ); 1026 assert( false , "not implemented file_xp: %x, path <%s>, mode: %x\n", 1027 file_xp, path, mode ); 1024 1028 return 0; 1025 1029 } … … 1029 1033 char * path ) 1030 1034 { 1031 assert( false , __FUNCTION__ , "not implemented\n", file_xp, path ); 1035 assert( false , "not implemented file_xp: %x, path <%s>\n", 1036 file_xp, path ); 1032 1037 return 0; 1033 1038 } … … 1065 1070 } 1066 1071 1067 assert( false , __FUNCTION__ ,"not implemented\n" );1072 assert( false , "not implemented\n" ); 1068 1073 return 0; 1069 1074 } … … 1097 1102 1098 1103 1099 assert( false , __FUNCTION__ ,"not implemented\n" );1104 assert( false , "not implemented\n" ); 1100 1105 return 0; 1101 1106 } … … 1106 1111 uint32_t rights ) 1107 1112 { 1108 assert( false , __FUNCTION__ , "not implemented\n", cwd_xp, path, rights ); 1113 assert( false , "not implemented cwd_xp: %x, path <%s>, rights %x\n", 1114 cwd_xp, path, rights ); 1109 1115 return 0; 1110 1116 } … … 1168 1174 " " }; // level 15 1169 1175 1170 assert( (inode_xp != XPTR_NULL) , __FUNCTION__ ,"inode_xp cannot be NULL\n" );1171 assert( (name_xp != XPTR_NULL) , __FUNCTION__ ,"name_xp cannot be NULL\n" );1172 assert( (indent < 16) , __FUNCTION__ ,"depth cannot be larger than 15\n" );1176 assert( (inode_xp != XPTR_NULL) , "inode_xp cannot be NULL\n" ); 1177 assert( (name_xp != XPTR_NULL) , "name_xp cannot be NULL\n" ); 1178 assert( (indent < 16) , "depth cannot be larger than 15\n" ); 1173 1179 1174 1180 // get inode cluster and local pointer … … 1944 1950 error_t error = 0; 1945 1951 1946 assert( (page != NULL) , __FUNCTION__ ,"page pointer is NULL\n" );1952 assert( (page != NULL) , "page pointer is NULL\n" ); 1947 1953 1948 1954 mapper_t * mapper = page->mapper; 1949 1955 1950 assert( (mapper != NULL) , __FUNCTION__ ,"no mapper for page\n" );1956 assert( (mapper != NULL) , "no mapper for page\n" ); 1951 1957 1952 1958 #if DEBUG_VFS_MAPPER_MOVE … … 1969 1975 else if( fs_type == FS_TYPE_RAMFS ) 1970 1976 { 1971 assert( false , __FUNCTION__ ,"should not be called for RAMFS\n" );1977 assert( false , "should not be called for RAMFS\n" ); 1972 1978 } 1973 1979 else if( fs_type == FS_TYPE_DEVFS ) 1974 1980 { 1975 assert( false , __FUNCTION__ ,"should not be called for DEVFS\n" );1981 assert( false , "should not be called for DEVFS\n" ); 1976 1982 } 1977 1983 else 1978 1984 { 1979 assert( false , __FUNCTION__ ,"undefined file system type\n" );1985 assert( false , "undefined file system type\n" ); 1980 1986 } 1981 1987 … … 1994 2000 error_t vfs_mapper_load_all( vfs_inode_t * inode ) 1995 2001 { 1996 assert( (inode != NULL) , __FUNCTION__ ,"inode pointer is NULL\n" );2002 assert( (inode != NULL) , "inode pointer is NULL\n" ); 1997 2003 1998 2004 uint32_t index; … … 2002 2008 uint32_t size = inode->size; 2003 2009 2004 assert( (mapper != NULL) , __FUNCTION__ ,"mapper pointer is NULL\n" );2010 assert( (mapper != NULL) , "mapper pointer is NULL\n" ); 2005 2011 2006 2012 #if DEBUG_VFS_MAPPER_LOAD
Note: See TracChangeset
for help on using the changeset viewer.