Changeset 610 for trunk/kernel/fs/fatfs.c
- Timestamp:
- Dec 27, 2018, 7:38:58 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/fs/fatfs.c
r602 r610 1246 1246 vfs_inode_get_name( XPTR( local_cxy , inode ) , dir_name ); 1247 1247 if( DEBUG_FATFS_REMOVE_DENTRY < cycle ) 1248 printk("\n[%s] 1248 printk("\n[%s] thread[%x,%x] enter / parent <%s> / child <%s> / cycle %d\n", 1249 1249 __FUNCTION__, this->process->pid, this->trdid, dir_name, dentry->name, cycle ); 1250 1250 #endif … … 1280 1280 uint32_t page_id = dentry_id >> 7; 1281 1281 uint32_t offset = (dentry_id & 0x7F)<<5; 1282 1283 #if DEBUG_FATFS_REMOVE_DENTRY & 1 1284 if( DEBUG_FATFS_REMOVE_DENTRY < cycle ) 1285 printk("\n[%s] dentry_id %x / page_id %x / offset %x\n", 1286 __FUNCTION__, dentry_id, page_id, offset ); 1287 #endif 1282 1288 1283 1289 // get extended pointer on page descriptor from parent directory mapper … … 1345 1351 cycle = (uint32_t)hal_get_cycles(); 1346 1352 if( DEBUG_FATFS_REMOVE_DENTRY < cycle ) 1347 printk("\n[%s] 1353 printk("\n[%s] thread[%x,%x] exit / parent %s / child %s / cycle %d\n", 1348 1354 __FUNCTION__, this->process->pid, this->trdid, dir_name, dentry->name, cycle ); 1349 1355 #endif … … 1358 1364 xptr_t child_inode_xp ) 1359 1365 { 1360 // Two embedded loops :1366 // Two embedded loops to scan the directory mapper: 1361 1367 // - scan the parent directory mapper pages 1362 1368 // - scan the directory entries in each 4 Kbytes page … … 1512 1518 // get child inode cluster and local pointer 1513 1519 cxy_t inode_cxy = GET_CXY( child_inode_xp ); 1514 vfs_inode_t * inode_ptr = (vfs_inode_t *)GET_PTR( child_inode_xp ); 1520 vfs_inode_t * inode_ptr = GET_PTR( child_inode_xp ); 1521 1522 // build extended pointer on parent dentried root 1523 xptr_t parents_root_xp = XPTR( inode_cxy , &inode_ptr->parents ); 1524 1525 // check child inode has at least one parent 1526 assert( (xlist_is_empty( parents_root_xp ) == false ), "child inode must have one parent\n"); 1515 1527 1516 1528 // get dentry pointers and cluster 1517 xptr_t dentry_xp = hal_remote_l64( XPTR( inode_cxy , &inode_ptr->parent_xp ) );1529 xptr_t dentry_xp = XLIST_FIRST( parents_root_xp , vfs_dentry_t , parents ); 1518 1530 vfs_dentry_t * dentry_ptr = GET_PTR( dentry_xp ); 1519 1531 cxy_t dentry_cxy = GET_CXY( dentry_xp ); 1520 1532 1521 // dentry descriptor must bein same cluster as parent inode1533 // check dentry descriptor in same cluster as parent inode 1522 1534 assert( (dentry_cxy == local_cxy) , "illegal dentry cluster\n" ); 1523 1535
Note: See TracChangeset
for help on using the changeset viewer.