Changeset 407 for trunk/kernel/fs/fatfs.c
- Timestamp:
- Nov 7, 2017, 3:08:12 PM (7 years ago)
- Location:
- trunk/kernel/fs
- Files:
-
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/fs/fatfs.c
r406 r407 262 262 "no FAT access required for first page\n"); 263 263 264 fatfs_dmsg("\n[DMSG] %s : enter / first_cluster_id = %d / searched_page_index = %d\n",265 __FUNCTION__ , first_cluster_id, searched_page_index );264 fatfs_dmsg("\n[DBG] %s : core[%x,%d] enters / first_cluster_id = %d / searched_index = %d\n", 265 __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, first_cluster_id, searched_page_index ); 266 266 267 267 // get number of FAT slots per page … … 289 289 next_cluster_id = current_page_buffer[current_page_offset]; 290 290 291 fatfs_dmsg("\n[DMSG] %s : traverse FAT / current_page_index = %d\n" 292 " current_page_offset = %d / next_cluster_id = %d\n", 293 __FUNCTION__ , current_page_index , current_page_offset , next_cluster_id ); 291 fatfs_dmsg("\n[DBG] %s : core[%x,%d] traverse FAT / current_page_index = %d\n" 292 "current_page_offset = %d / next_cluster_id = %d\n", 293 __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, current_page_index, 294 current_page_offset , next_cluster_id ); 294 295 295 296 // update loop variables … … 301 302 if( next_cluster_id == 0xFFFFFFFF ) return EIO; 302 303 303 fatfs_dmsg("\n[DMSG] %s : exit / cluster_id = %d\n", __FUNCTION__ , next_cluster_id ); 304 fatfs_dmsg("\n[DBG] %s : core[%x;%d] exit / cluster_id = %d\n", 305 __FUNCTION__ , local_cxy, CURRENT_THREAD->core->lid, next_cluster_id ); 304 306 305 307 *searched_cluster_id = next_cluster_id; … … 333 335 uint8_t * buffer; 334 336 335 fatfs_dmsg("\n[D MSG] %s : enter for fatfs_ctx = %x\n",337 fatfs_dmsg("\n[DBG] %s : enter for fatfs_ctx = %x\n", 336 338 __FUNCTION__ , fatfs_ctx ); 337 339 … … 347 349 "cannot allocate memory for 512 bytes buffer\n" ); 348 350 349 fatfs_dmsg("\n[D MSG] %s : allocated 512 bytes buffer\n", __FUNCTION__ );351 fatfs_dmsg("\n[DBG] %s : allocated 512 bytes buffer\n", __FUNCTION__ ); 350 352 351 353 // load the boot record from device … … 353 355 error = dev_ioc_sync_read( buffer , 0 , 1 ); 354 356 355 fatfs_dmsg("\n[DMSG] %s : buffer loaded\n", __FUNCTION__ );357 fatfs_dmsg("\n[DBG] %s : buffer loaded\n", __FUNCTION__ ); 356 358 357 359 assert( (error == 0) , __FUNCTION__ , "cannot access boot record\n" ); … … 415 417 kmem_free( &req ); 416 418 417 fatfs_dmsg("\n[D MSG] %s : boot record read & released\n",419 fatfs_dmsg("\n[DBG] %s : boot record read & released\n", 418 420 __FUNCTION__ ); 419 421 … … 437 439 fatfs_ctx->fat_mapper_xp = XPTR( local_cxy , fat_mapper ); 438 440 439 fatfs_dmsg("\n[DMSG] %s : exit for fatfs_ctx = %x\n", 440 __FUNCTION__ , fatfs_ctx ); 441 fatfs_dmsg("\n[DBG] %s : exit for fatfs_ctx = %x\n", __FUNCTION__ , fatfs_ctx ); 441 442 442 443 } // end fatfs_ctx_init() … … 471 472 inode = mapper->inode; 472 473 473 fatfs_dmsg("\n[DMSG] %s : core[%x,%d] enter for page %d / inode %x / mapper %x\n",474 474 fatfs_dmsg("\n[DBG] %s : core[%x,%d] enter for page %d / inode %x / mapper %x\n", 475 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , index , inode , mapper ); 475 476 476 477 // get page base address … … 488 489 lba = fatfs_ctx->fat_begin_lba + (count * index); 489 490 490 fatfs_dmsg("\n[DMSG] %s : core[%x,%d] access FAT on device / lba = %d\n",491 491 fatfs_dmsg("\n[DBG] %s : core[%x,%d] access FAT on device / lba = %d\n", 492 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , lba ); 492 493 493 494 // access device … … 511 512 else // FAT mapper access required 512 513 { 513 fatfs_dmsg("\n[DMSG] %s : core[%x,%d] must access FAT\n",514 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid );515 516 514 // get cluster and local pointer on FAT mapper 517 515 xptr_t fat_mapper_xp = fatfs_ctx->fat_mapper_xp; … … 522 520 if( fat_mapper_cxy == local_cxy ) // FAT mapper is local 523 521 { 522 523 fatfs_dmsg("\n[DBG] %s : core[%x,%d] access local FAT mapper\n" 524 "fat_mapper_cxy = %x / fat_mapper_ptr = %x / first_cluster_id = %d / index = %d\n", 525 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , 526 fat_mapper_cxy , fat_mapper_ptr , first_cluster_id , index ); 527 524 528 error = fatfs_get_cluster( fat_mapper_ptr, 525 529 first_cluster_id, … … 529 533 else // FAT mapper is remote 530 534 { 535 536 fatfs_dmsg("\n[DBG] %s : core[%x,%d] access remote FAT mapper\n" 537 "fat_mapper_cxy = %x / fat_mapper_ptr = %x / first_cluster_id = %d / index = %d\n", 538 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , 539 fat_mapper_cxy , fat_mapper_ptr , first_cluster_id , index ); 540 531 541 rpc_fatfs_get_cluster_client( fat_mapper_cxy, 532 542 fat_mapper_ptr, … … 540 550 } 541 551 542 fatfs_dmsg("\n[DMSG] %s : core[%x,%d] access device for inode %x / cluster_id %d\n",543 552 fatfs_dmsg("\n[DBG] %s : core[%x,%d] access device for inode %x / cluster_id %d\n", 553 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , inode , searched_cluster_id ); 544 554 545 555 // get lba from cluster_id … … 553 563 } 554 564 555 fatfs_dmsg("\n[DMSG] %s : core[%x,%d] exit for page %d / inode %x / mapper %x\n",556 565 fatfs_dmsg("\n[DBG] %s : core[%x,%d] exit for page %d / inode %x / mapper %x\n", 566 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , index , inode , mapper ); 557 567 558 568 #if (CONFIG_FATFS_DEBUG & 0x1) … … 584 594 // - scan the directory entries in each 4 Kbytes page 585 595 586 fatfs_dmsg("\n[DMSG] %s : enter for child <%s> in parent inode %l\n",587 596 fatfs_dmsg("\n[DBG] %s : enter for child <%s> in parent inode %l\n", 597 __FUNCTION__ , name , XPTR( local_cxy , parent_inode ) ); 588 598 589 599 mapper_t * mapper = parent_inode->mapper; … … 705 715 if ( found == -1 ) // found end of directory => failure 706 716 { 707 fatfs_dmsg("\n[DMSG] %s : exit / child <%s> not found in parent inode %l\n", 708 __FUNCTION__ , name , XPTR( local_cxy , parent_inode ) ); 717 718 fatfs_dmsg("\n[DBG] %s : exit / child <%s> not found in parent inode %l\n", 719 __FUNCTION__ , name , XPTR( local_cxy , parent_inode ) ); 709 720 710 721 return ENOENT; … … 723 734 hal_remote_sw( XPTR( child_cxy , &child_ptr->extend ) , cluster ); 724 735 725 fatfs_dmsg("\n[DMSG] %s : exit / child <%s> found in parent inode %l\n",726 736 fatfs_dmsg("\n[DBG] %s : exit / child <%s> found in parent inode %l\n", 737 __FUNCTION__ , name , XPTR( local_cxy , parent_inode ) ); 727 738 728 739 return 0;
Note: See TracChangeset
for help on using the changeset viewer.