Changeset 265 for trunk/kernel/vfs/vfs.c
- Timestamp:
- Jul 21, 2017, 7:36:08 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/vfs/vfs.c
r246 r265 640 640 if( error ) return error; 641 641 642 vfs_dmsg("\n[INFO] %s exit for %s/ file_id = %d / file_xp = %l / at cycle %d\n",642 vfs_dmsg("\n[INFO] %s : exit for <%s> / file_id = %d / file_xp = %l / at cycle %d\n", 643 643 __FUNCTION__ , path , file_id , file_xp , hal_get_cycles() ); 644 644 … … 652 652 ///////////////////////////////////// 653 653 error_t vfs_move( bool_t to_buffer, 654 bool_t is_user, 654 655 xptr_t file_xp, 655 656 void * buffer, … … 682 683 if( file_cxy == local_cxy ) 683 684 { 684 error = mapper_move( mapper, 685 to_buffer, 686 file_offset, 687 buffer, 688 size ); 685 error = mapper_move_buffer( mapper, 686 to_buffer, 687 is_user, 688 file_offset, 689 buffer, 690 size ); 689 691 } 690 692 else 691 693 { 692 rpc_mapper_move_client( file_cxy, 693 mapper, 694 to_buffer, 695 file_offset, 696 buffer, 697 size, 698 &error ); 694 rpc_mapper_move_buffer_client( file_cxy, 695 mapper, 696 to_buffer, 697 is_user, 698 file_offset, 699 buffer, 700 size, 701 &error ); 699 702 } 700 703 701 return error; 702 } 703 else if (inode_type == INODE_TYPE_DIR ) 704 { 705 printk("\n[ERROR] in %s : inode is a directory", __FUNCTION__ ); 706 return EINVAL; 707 } 708 else if (inode_type == INODE_TYPE_DEV ) 709 { 710 // TODO [AG] 711 return 0; 712 } 713 else 714 { 715 printk("\n[PANIC] in %s : illegal inode type\n", __FUNCTION__ ); 716 hal_core_sleep(); 704 if( error ) return -1; 705 else return size; 706 } 707 else 708 { 709 printk("\n[ERROR] in %s : inode is not a file", __FUNCTION__ ); 717 710 return -1; 718 711 } … … 1377 1370 vfs_inode_unlock( parent_xp ); 1378 1371 1379 vfs_dmsg("\n[INFO] in %s : exit / %sfound / inode = %l\n",1372 vfs_dmsg("\n[INFO] in %s : exit <%s> found / inode = %l\n", 1380 1373 __FUNCTION__ , pathname , child_xp ); 1381 1374 … … 1609 1602 error_t vfs_mapper_load_all( vfs_inode_t * inode ) 1610 1603 { 1611 assert( (inode != NULL) , __FUNCTION__ , " page pointer is NULL\n" );1604 assert( (inode != NULL) , __FUNCTION__ , "inode pointer is NULL\n" ); 1612 1605 1613 1606 uint32_t index; … … 1617 1610 uint32_t size = inode->size; 1618 1611 1619 assert( (mapper != NULL) , __FUNCTION__ , "no mapper for page\n" ); 1620 1621 assert( (size != 0) , __FUNCTION__ , "size cannot be 0\n"); 1612 assert( (mapper != NULL) , __FUNCTION__ , "mapper pointer is NULL\n" ); 1622 1613 1623 1614 uint32_t npages = size >> CONFIG_PPM_PAGE_SHIFT; 1624 if( size & CONFIG_PPM_PAGE_MASK) npages++;1625 1626 // loop on allpages1615 if( (size & CONFIG_PPM_PAGE_MASK) || (size == 0) ) npages++; 1616 1617 // loop on pages 1627 1618 for( index = 0 ; index < npages ; index ++ ) 1628 1619 {
Note: See TracChangeset
for help on using the changeset viewer.