Changeset 246 for trunk/kernel/vfs/vfs.c
- Timestamp:
- Jul 20, 2017, 12:55:23 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/vfs/vfs.c
r238 r246 161 161 { 162 162 ctx = NULL; 163 printk("\n[PANIC] in %s : undefined file system type\n", __FUNCTION__);163 printk("\n[PANIC] in %s : illegal file system type = %d\n", __FUNCTION__ , fs_type ); 164 164 hal_core_sleep(); 165 165 } … … 175 175 176 176 // allocate memory for mapper 177 mapper = mapper_create( );177 mapper = mapper_create( fs_type ); 178 178 179 179 if( mapper == NULL ) … … 209 209 inode->parent_xp = dentry_xp; 210 210 inode->ctx = ctx; 211 inode->mapper = NULL;211 inode->mapper = mapper; 212 212 inode->extend = extend; 213 213 214 // initialise inode field in mapper 215 mapper->inode = inode; 216 214 217 // initialise threads waiting queue 215 218 xlist_root_init( XPTR( local_cxy , &inode->wait_root ) ); … … 253 256 xptr_t child_xp ) 254 257 { 258 vfs_dmsg("\n[INFO] %s : enter for child <%s>\n", 259 __FUNCTION__ , name ); 260 255 261 error_t error = 0; 256 262 … … 279 285 assert( false , __FUNCTION__ , "undefined file system type\n" ); 280 286 } 287 288 vfs_dmsg("\n[INFO] %s : exit for child <%s>\n", 289 __FUNCTION__ , name ); 281 290 282 291 return error; … … 1253 1262 // for the last name, the behaviour depends on the "mode" argument: 1254 1263 1255 if (found == false ) // directorynode not found in inode tree1264 if (found == false ) // child node not found in inode tree 1256 1265 { 1257 1266 vfs_dmsg("\n[INFO] %s : <%s> not found, try to load it\n", … … 1559 1568 assert( (page != NULL) , __FUNCTION__ , "page pointer is NULL\n" ); 1560 1569 1561 mapper_t * mapper = page->mapper; 1570 mapper_t * mapper = page->mapper; 1571 1562 1572 1563 1573 assert( (mapper != NULL) , __FUNCTION__ , "no mapper for page\n" ); 1564 1574 1575 vfs_dmsg("\n[INFO] %s : enters for page = %d in mapper = %x\n", 1576 __FUNCTION__ , page->index , mapper ); 1577 1565 1578 // get FS type 1566 vfs_fs_type_t fs_type = mapper-> inode->ctx->type;1579 vfs_fs_type_t fs_type = mapper->type; 1567 1580 1568 1581 // call relevant FS function … … 1570 1583 { 1571 1584 rwlock_wr_lock( &mapper->lock ); 1572 error = fatfs_m ove_page( page , to_mapper );1585 error = fatfs_mapper_move_page( page , to_mapper ); 1573 1586 rwlock_wr_unlock( &mapper->lock ); 1574 1587 } … … 1585 1598 assert( false , __FUNCTION__ , "undefined file system type\n" ); 1586 1599 } 1600 1601 vfs_dmsg("\n[INFO] %s : exit for page = %d in mapper = %x\n", 1602 __FUNCTION__ , page->index , mapper ); 1587 1603 1588 1604 return error;
Note: See TracChangeset
for help on using the changeset viewer.