Changeset 438 for trunk/kernel/fs/vfs.c
- Timestamp:
- Apr 4, 2018, 2:49:02 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/fs/vfs.c
r437 r438 157 157 error_t error; 158 158 159 #if CONFIG_DEBUG_VFS_INODE_CREATE159 #if DEBUG_VFS_INODE_CREATE 160 160 uint32_t cycle = (uint32_t)hal_get_cycles(); 161 if( CONFIG_DEBUG_VFS_INODE_CREATE < cycle )161 if( DEBUG_VFS_INODE_CREATE < cycle ) 162 162 printk("\n[DBG] %s : thread %x enter / dentry = %x in cluster %x / cycle %d\n", 163 163 __FUNCTION__, CURRENT_THREAD, GET_PTR(dentry_xp), GET_CXY(dentry_xp), cycle ); … … 234 234 remote_spinlock_init( XPTR( local_cxy , &inode->main_lock ) ); 235 235 236 #if CONFIG_DEBUG_VFS_INODE_CREATE236 #if DEBUG_VFS_INODE_CREATE 237 237 cycle = (uint32_t)hal_get_cycles(); 238 if( CONFIG_DEBUG_VFS_INODE_CREATE < cycle )238 if( DEBUG_VFS_INODE_CREATE < cycle ) 239 239 printk("\n[DBG] %s : thread %x exit / inode = %x in cluster %x / cycle %d\n", 240 240 __FUNCTION__, CURRENT_THREAD, inode, local_cxy, cycle ); … … 272 272 { 273 273 274 #if CONFIG_DEBUG_VFS_INODE_LOAD274 #if DEBUG_VFS_INODE_LOAD 275 275 uint32_t cycle = (uint32_t)hal_get_cycles(); 276 if( CONFIG_DEBUG_VFS_INODE_LOAD < cycle )276 if( DEBUG_VFS_INODE_LOAD < cycle ) 277 277 printk("\n[DBG] %s : thread %x enter for <%s> / cycle %d\n", 278 278 __FUNCTION__, CURRENT_THREAD , name , cycle ); … … 306 306 } 307 307 308 #if CONFIG_DEBUG_VFS_INODE_LOAD308 #if DEBUG_VFS_INODE_LOAD 309 309 cycle = (uint32_t)hal_get_cycles(); 310 if( CONFIG_DEBUG_VFS_INODE_LOAD < cycle )310 if( DEBUG_VFS_INODE_LOAD < cycle ) 311 311 printk("\n[DBG] %s : thread %x exit for <%s> / cycle %d\n", 312 312 __FUNCTION__, CURRENT_THREAD , name , cycle ); … … 433 433 kmem_req_t req; // request to kernel memory allocator 434 434 435 #if CONFIG_DEBUG_VFS_DENTRY_CREATE435 #if DEBUG_VFS_DENTRY_CREATE 436 436 uint32_t cycle = (uint32_t)hal_get_cycles(); 437 if( CONFIG_DEBUG_VFS_DENTRY_CREATE < cycle )437 if( DEBUG_VFS_DENTRY_CREATE < cycle ) 438 438 printk("\n[DBG] %s : thread %x enter for <%s> / parent_inode %x / cycle %d\n", 439 439 __FUNCTION__, CURRENT_THREAD , name , parent , cycle ); … … 456 456 { 457 457 458 #if CONFIG_DEBUG_SYSCALLS_ERROR458 #if DEBUG_SYSCALLS_ERROR 459 459 printk("\n[ERROR] in %s : name <name> too long\n", __FUNCTION__ , name ); 460 460 #endif … … 471 471 { 472 472 473 #if CONFIG_DEBUG_SYSCALLS_ERROR473 #if DEBUG_SYSCALLS_ERROR 474 474 printk("\n[ERROR] in %s : cannot allocate dentry\n", __FUNCTION__ ); 475 475 #endif … … 484 484 strcpy( dentry->name , name ); 485 485 486 #if( CONFIG_DEBUG_VFS_DENTRY_CREATE & 1 )486 #if( DEBUG_VFS_DENTRY_CREATE & 1 ) 487 487 cycle = (uint32_t)hal_get_cycles(); 488 if( CONFIG_DEBUG_VFS_DENTRY_CREATE < cycle )488 if( DEBUG_VFS_DENTRY_CREATE < cycle ) 489 489 printk("\n[DBG] %s : dentry initialised\n", __FUNCTION__ ); 490 490 #endif … … 495 495 XPTR( local_cxy , &dentry->list ) ); 496 496 497 #if( CONFIG_DEBUG_VFS_DENTRY_CREATE & 1 )497 #if( DEBUG_VFS_DENTRY_CREATE & 1 ) 498 498 cycle = (uint32_t)hal_get_cycles(); 499 if( CONFIG_DEBUG_VFS_DENTRY_CREATE < cycle )499 if( DEBUG_VFS_DENTRY_CREATE < cycle ) 500 500 printk("\n[DBG] %s : dentry registerd in htab\n", __FUNCTION__ ); 501 501 #endif … … 504 504 *dentry_xp = XPTR( local_cxy , dentry ); 505 505 506 #if CONFIG_DEBUG_VFS_DENTRY_CREATE506 #if DEBUG_VFS_DENTRY_CREATE 507 507 cycle = (uint32_t)hal_get_cycles(); 508 if( CONFIG_DEBUG_VFS_DENTRY_CREATE < cycle )508 if( DEBUG_VFS_DENTRY_CREATE < cycle ) 509 509 printk("\n[DBG] %s : thread %x exit for <%s> / dentry %x / cycle %d\n", 510 510 __FUNCTION__, CURRENT_THREAD , name , dentry , cycle ); … … 627 627 uint32_t file_id; // created file descriptor index in reference fd_array 628 628 629 #if CONFIG_DEBUG_VFS_OPEN629 #if DEBUG_VFS_OPEN 630 630 uint32_t cycle = (uint32_t)hal_get_cycles(); 631 if( CONFIG_DEBUG_VFS_OPEN < cycle )631 if( DEBUG_VFS_OPEN < cycle ) 632 632 printk("\n[DBG] %s : thread %x enter for <%s> / cycle %d\n", 633 633 __FUNCTION__, CURRENT_THREAD, path, cycle ); … … 674 674 if( error ) return error; 675 675 676 #if CONFIG_DEBUG_VFS_OPEN676 #if DEBUG_VFS_OPEN 677 677 cycle = (uint32_t)hal_get_cycles(); 678 if( CONFIG_DEBUG_VFS_OPEN < cycle )678 if( DEBUG_VFS_OPEN < cycle ) 679 679 printk("\n[DBG] %s : thread %x exit for <%s> / file %x in cluster %x / cycle %d\n", 680 680 __FUNCTION__, CURRENT_THREAD, path, GET_PTR(file_xp), GET_CXY(file_xp), cycle ); … … 1365 1365 process = this->process; 1366 1366 1367 #if CONFIG_DEBUG_VFS_LOOKUP1367 #if DEBUG_VFS_LOOKUP 1368 1368 uint32_t cycle = (uint32_t)hal_get_cycles(); 1369 if( CONFIG_DEBUG_VFS_LOOKUP < cycle )1369 if( DEBUG_VFS_LOOKUP < cycle ) 1370 1370 printk("\n[DBG] %s : thread %x enter for <%s> / cycle %d\n", 1371 1371 __FUNCTION__, CURRENT_THREAD, pathname, cycle ); … … 1393 1393 vfs_get_name_from_path( current , name , &next , &last ); 1394 1394 1395 #if ( CONFIG_DEBUG_VFS_LOOKUP & 1)1396 if( CONFIG_DEBUG_VFS_LOOKUP < cycle )1395 #if (DEBUG_VFS_LOOKUP & 1) 1396 if( DEBUG_VFS_LOOKUP < cycle ) 1397 1397 printk("\n[DBG] %s : look for <%s> / last = %d\n", __FUNCTION__ , name , last ); 1398 1398 #endif … … 1414 1414 { 1415 1415 1416 #if ( CONFIG_DEBUG_VFS_LOOKUP & 1)1417 if( CONFIG_DEBUG_VFS_LOOKUP < cycle )1416 #if (DEBUG_VFS_LOOKUP & 1) 1417 if( DEBUG_VFS_LOOKUP < cycle ) 1418 1418 printk("\n[DBG] %s : miss <%s> => load it\n", __FUNCTION__ , name ); 1419 1419 #endif … … 1500 1500 vfs_inode_lock( parent_xp ); 1501 1501 1502 #if ( CONFIG_DEBUG_VFS_LOOKUP & 1)1503 if( CONFIG_DEBUG_VFS_LOOKUP < cycle )1502 #if (DEBUG_VFS_LOOKUP & 1) 1503 if( DEBUG_VFS_LOOKUP < cycle ) 1504 1504 printk("\n[DBG] %s : created node <%s>\n", __FUNCTION__ , name ); 1505 1505 #endif … … 1507 1507 } 1508 1508 1509 #if ( CONFIG_DEBUG_VFS_LOOKUP & 1)1510 if( CONFIG_DEBUG_VFS_LOOKUP < cycle )1509 #if (DEBUG_VFS_LOOKUP & 1) 1510 if( DEBUG_VFS_LOOKUP < cycle ) 1511 1511 printk("\n[DBG] %s : found <%s> / inode %x in cluster %x\n", 1512 1512 __FUNCTION__ , name , GET_PTR(child_xp) , GET_CXY(child_xp) ); … … 1536 1536 vfs_inode_unlock( parent_xp ); 1537 1537 1538 #if CONFIG_DEBUG_VFS_LOOKUP1538 #if DEBUG_VFS_LOOKUP 1539 1539 cycle = (uint32_t)hal_get_cycles(); 1540 if( CONFIG_DEBUG_VFS_LOOKUP < cycle )1540 if( DEBUG_VFS_LOOKUP < cycle ) 1541 1541 printk("\n[DBG] %s : thread %x exit for <%s> / inode %x in cluster %x / cycle %d\n", 1542 1542 __FUNCTION__, CURRENT_THREAD, pathname, GET_PTR(child_xp), GET_CXY(child_xp), cycle ); … … 1639 1639 parent_ptr = (vfs_inode_t *)GET_PTR( parent_xp ); 1640 1640 1641 #if CONFIG_DEBUG_VFS_ADD_CHILD1641 #if DEBUG_VFS_ADD_CHILD 1642 1642 uint32_t cycle = (uint32_t)hal_get_cycles(); 1643 if( CONFIG_DEBUG_VFS_ADD_CHILD < cycle )1643 if( DEBUG_VFS_ADD_CHILD < cycle ) 1644 1644 printk("\n[DBG] %s : thread %x enter for <%s> / child_cxy = %x / parent_cxy = %x\n", 1645 1645 __FUNCTION__ , CURRENT_THREAD , name , child_cxy , parent_cxy ); … … 1654 1654 &dentry_xp ); 1655 1655 1656 #if ( CONFIG_DEBUG_VFS_ADD_CHILD & 1)1657 if( ( CONFIG_DEBUG_VFS_ADD_CHILD < cycle) && (error == 0) )1656 #if (DEBUG_VFS_ADD_CHILD & 1) 1657 if( (DEBUG_VFS_ADD_CHILD < cycle) && (error == 0) ) 1658 1658 printk("\n[DBG] %s : dentry <%s> created in cluster %x\n", __FUNCTION__, name, local_cxy ); 1659 1659 #endif … … 1669 1669 &error ); 1670 1670 1671 #if ( CONFIG_DEBUG_VFS_ADD_CHILD & 1)1672 if( ( CONFIG_DEBUG_VFS_ADD_CHILD < cycle) && (error == 0) )1671 #if (DEBUG_VFS_ADD_CHILD & 1) 1672 if( (DEBUG_VFS_ADD_CHILD < cycle) && (error == 0) ) 1673 1673 printk("\n[DBG] %s : dentry <%s> created in cluster %x\n", __FUNCTION__, name, parent_cxy ); 1674 1674 #endif … … 1701 1701 &inode_xp ); 1702 1702 1703 #if ( CONFIG_DEBUG_VFS_ADD_CHILD & 1)1704 if( CONFIG_DEBUG_VFS_ADD_CHILD < cycle )1703 #if (DEBUG_VFS_ADD_CHILD & 1) 1704 if( DEBUG_VFS_ADD_CHILD < cycle ) 1705 1705 printk("\n[DBG] %s : inode <%x> created in cluster %x\n", 1706 1706 __FUNCTION__ , GET_PTR(inode_xp) , local_cxy ); … … 1722 1722 &error ); 1723 1723 1724 #if ( CONFIG_DEBUG_VFS_ADD_CHILD & 1)1725 if( CONFIG_DEBUG_VFS_ADD_CHILD < cycle )1724 #if (DEBUG_VFS_ADD_CHILD & 1) 1725 if( DEBUG_VFS_ADD_CHILD < cycle ) 1726 1726 printk("\n[DBG] %s : inode <%s> created in cluster %x\n", 1727 1727 __FUNCTION__ , GET_PTR(inode_xp) , child_cxy ); … … 1746 1746 hal_remote_swd( XPTR( dentry_cxy , &dentry_ptr->child_xp ) , inode_xp ); 1747 1747 1748 #if CONFIG_DEBUG_VFS_ADD_CHILD1748 #if DEBUG_VFS_ADD_CHILD 1749 1749 cycle = (uint32_t)hal_get_cycles(); 1750 if( CONFIG_DEBUG_VFS_ADD_CHILD < cycle )1750 if( DEBUG_VFS_ADD_CHILD < cycle ) 1751 1751 printk("\n[DBG] %s : thread %x exit for <%s>\n", 1752 1752 __FUNCTION__ , CURRENT_THREAD , name ); … … 1775 1775 assert( (mapper != NULL) , __FUNCTION__ , "no mapper for page\n" ); 1776 1776 1777 #if CONFIG_DEBUG_VFS_MAPPER_MOVE1777 #if DEBUG_VFS_MAPPER_MOVE 1778 1778 uint32_t cycle = (uint32_t)hal_get_cycles(); 1779 if( CONFIG_DEBUG_VFS_MAPPER_MOVE < cycle )1779 if( DEBUG_VFS_MAPPER_MOVE < cycle ) 1780 1780 printk("\n[DBG] %s : thread %x enter for page %d / mapper %x / inode %x / cycle %d\n", 1781 1781 __FUNCTION__, CURRENT_THREAD, page->index, mapper, mapper->inode, cycle ); … … 1805 1805 } 1806 1806 1807 #if CONFIG_DEBUG_VFS_MAPPER_MOVE1807 #if DEBUG_VFS_MAPPER_MOVE 1808 1808 cycle = (uint32_t)hal_get_cycles(); 1809 if( CONFIG_DEBUG_VFS_MAPPER_MOVE < cycle )1809 if( DEBUG_VFS_MAPPER_MOVE < cycle ) 1810 1810 printk("\n[DBG] %s : thread %x exit for page %d / mapper %x / inode %x / cycle %d\n", 1811 1811 __FUNCTION__, CURRENT_THREAD, page->index, mapper, mapper->inode, cycle ); … … 1829 1829 assert( (mapper != NULL) , __FUNCTION__ , "mapper pointer is NULL\n" ); 1830 1830 1831 #if CONFIG_DEBUG_VFS_MAPPER_LOAD1831 #if DEBUG_VFS_MAPPER_LOAD 1832 1832 uint32_t cycle = (uint32_t)hal_get_cycles(); 1833 if( CONFIG_DEBUG_VFS_MAPPER_MOVE < cycle )1833 if( DEBUG_VFS_MAPPER_MOVE < cycle ) 1834 1834 printk("\n[DBG] %s : thread %x enter for inode %x in cluster %x / cycle %d\n", 1835 1835 __FUNCTION__, CURRENT_THREAD, inode, local_cxy, cycle ); … … 1850 1850 } 1851 1851 1852 #if CONFIG_DEBUG_VFS_MAPPER_LOAD1852 #if DEBUG_VFS_MAPPER_LOAD 1853 1853 cycle = (uint32_t)hal_get_cycles(); 1854 if( CONFIG_DEBUG_VFS_MAPPER_MOVE < cycle )1854 if( DEBUG_VFS_MAPPER_MOVE < cycle ) 1855 1855 printk("\n[DBG] %s : thread %x exit for inode %x in cluster %x / cycle %d\n", 1856 1856 __FUNCTION__, CURRENT_THREAD, inode, local_cxy, cycle );
Note: See TracChangeset
for help on using the changeset viewer.