Changeset 401 for trunk/kernel/vfs/vfs.c


Ignore:
Timestamp:
Aug 17, 2017, 3:02:18 PM (7 years ago)
Author:
alain
Message:

Few bugs in VMM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/vfs/vfs.c

    r395 r401  
    156156    error_t            error;
    157157
    158     vfs_dmsg("\n[INFO] %s : enter / local_cxy = %x / parent_xp = %l\n",
    159     __FUNCTION__ , local_cxy , dentry_xp );
     158    vfs_dmsg("\n[INFO] %s : core[%x,%d] enter / dentry_xp = %l\n",
     159    __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , dentry_xp );
    160160 
    161161    // check fs type and get pointer on context
     
    229229    remote_spinlock_init( XPTR( local_cxy , &inode->main_lock ) );
    230230
    231     vfs_dmsg("\n[INFO] %s : exit / child_xp = %l / parent_xp = %l\n",
    232     __FUNCTION__ , XPTR( local_cxy , inode ) , dentry_xp );
    233 
     231    vfs_dmsg("\n[INFO] %s : core[%x,%d] exit / inode_xp = %l / dentry_xp = %l\n",
     232    __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, XPTR(local_cxy,inode), dentry_xp );
     233 
    234234    // return extended pointer on inode
    235235    *inode_xp = XPTR( local_cxy , inode );
     
    262262                        xptr_t        child_xp )
    263263{
    264     vfs_dmsg("\n[INFO] %s : enter for child <%s>\n",
    265              __FUNCTION__ , name );
     264    vfs_dmsg("\n[INFO] %s : core[%x,%d] enter for <%s> / cycle %d\n",
     265    __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , name , hal_time_stamp() );
    266266
    267267    error_t error = 0;
     
    292292    }
    293293
    294     vfs_dmsg("\n[INFO] %s : exit for child <%s>\n",
    295              __FUNCTION__ , name );
     294    vfs_dmsg("\n[INFO] %s : core[%x,%d] exit for <%s> / cycle %d\n",
     295    __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , name , hal_time_stamp() );
    296296
    297297    return error;
     
    435435        kmem_req_t       req;        // request to kernel memory allocator
    436436
    437     vfs_dmsg("\n[INFO] %s : enter for %s / parent inode = %x / cycle = %d\n",
    438     __FUNCTION__ , name , parent , hal_time_stamp() );
     437    vfs_dmsg("\n[INFO] %s : core[%x,%d] enter for <%s> / parent inode = %x / cycle %d\n",
     438    __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, name, parent, hal_time_stamp() );
    439439
    440440    // get pointer on context
     
    484484    *dentry_xp = XPTR( local_cxy , dentry );
    485485
    486     vfs_dmsg("\n[INFO] %s : exit for %s / cycle = %d\n",
    487     __FUNCTION__ , name , hal_time_stamp() );
     486    vfs_dmsg("\n[INFO] %s : core[%x,%d] exit for <%s> / dentry = %l / cycle %d\n",
     487    __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, name, *dentry_xp, hal_time_stamp() );
    488488
    489489    return 0;
     
    603603    uint32_t      file_id;      // created file descriptor index in reference fd_array
    604604
    605     vfs_dmsg("\n[INFO] %s : enters for <%s> at cycle %d\n",
    606              __FUNCTION__ , path , (uint32_t)hal_time_stamp() );
     605    vfs_dmsg("\n[INFO] %s : core[%x,%d] enter for <%s> / cycle %d\n",
     606    __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, path, (uint32_t)hal_time_stamp() );
    607607
    608608    // compute lookup working mode
     
    623623    error = vfs_lookup( cwd_xp , path , lookup_mode , &inode_xp );
    624624
    625     vfs_dmsg("\n[INFO] %s : get inode_xp = %l for <%s> at cycle %d\n",
    626              __FUNCTION__ , inode_xp , path , hal_get_cycles() );
    627 
    628625    if( error ) return error;
    629626
     
    649646    if( error ) return error;
    650647
    651     vfs_dmsg("\n[INFO] %s : exit for <%s> / file_id = %d / file_xp = %l / at cycle %d\n",
    652              __FUNCTION__ , path , file_id , file_xp , hal_get_cycles() );
     648    vfs_dmsg("\n[INFO] %s : core[%x,%d] exit for <%s> / file_xp = %l / cycle %d\n",
     649    __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, path, file_xp, hal_time_stamp() );
    653650
    654651    // success
     
    11851182
    11861183    // print header
    1187     nolock_printk("\n***** file system state\n");
     1184    nolock_printk("\n***** file system state\n\n");
    11881185
    11891186    // call recursive function
     
    13411338    process = this->process;
    13421339
    1343     vfs_dmsg("\n[INFO] %s : enter for <%s> / core[%x,%d] / cycle %d\n",
    1344     __FUNCTION__ , pathname , local_cxy , this->core->lid , hal_time_stamp() );
     1340    vfs_dmsg("\n[INFO] %s : core[%x,%d] enter for <%s> / cycle %d\n",
     1341    __FUNCTION__ , local_cxy , this->core->lid , pathname , hal_time_stamp() );
    13451342
    13461343    // get extended pointer on first inode to search
     
    13571354    vfs_inode_lock( parent_xp );
    13581355
    1359     // load from device if one intermediate node not found
    1360     // exit while loop when last name found (i.e. last == true)
     1356    // sequencially loop on nodes in pathname
     1357    // load from device if one node not found in inode tree
     1358    // exit loop when last name found (i.e. last == true)
    13611359    do
    13621360    {
    1363         // get one name from path, and the "last" flag
     1361        // get one name from path, and "last" flag
    13641362        vfs_get_name_from_path( current , name , &next , &last );
    13651363
    1366         vfs_dmsg("\n[INFO] %s : looking for <%s> / core[%x,%d] / last = %d\n",
    1367         __FUNCTION__ , name , local_cxy , this->core->lid , last );
     1364        vfs_dmsg("\n[INFO] %s : core[%x,%d] look for <%s> / last = %d\n",
     1365        __FUNCTION__ , local_cxy , this->core->lid , name , last );
    13681366
    13691367        // search a child dentry matching name in parent inode
     
    13821380        if (found == false ) // child node not found in inode tree
    13831381        {
    1384             vfs_dmsg("\n[INFO] %s : <%s> not found => load it / core[%x,%d]\n",
    1385             __FUNCTION__ , local_cxy , this->core->lid );
     1382            vfs_dmsg("\n[INFO] %s : core[%x,%d] miss <%s> => load it\n",
     1383            __FUNCTION__ , local_cxy , this->core->lid , name );
    13861384
    13871385            // release lock on parent inode
     
    13911389            parent_cxy = GET_CXY( parent_xp );
    13921390            parent_ptr = (vfs_inode_t *)GET_PTR( parent_xp );
    1393 
    1394             ctx_ptr    = (vfs_ctx_t *)hal_remote_lpt( XPTR( parent_cxy ,
    1395                                                             &parent_ptr->ctx ) );
     1391            ctx_ptr    = (vfs_ctx_t *)hal_remote_lpt( XPTR( parent_cxy , &parent_ptr->ctx ) );
    13961392            fs_type    = hal_remote_lw( XPTR( parent_cxy , &ctx_ptr->type ) );
    13971393
    13981394            // select a cluster for missing inode
    13991395            child_cxy = vfs_cluster_random_select();
    1400                     
     1396 
    14011397            // insert a new child dentry/inode in parent inode
    14021398            error = vfs_add_child_in_parent( child_cxy,
     
    14671463            // take lock on parent inode
    14681464            vfs_inode_lock( parent_xp );
     1465
     1466            vfs_dmsg("\n[INFO] %s : core[%x,%d] created node <%s>\n",
     1467            __FUNCTION__ , local_cxy , this->core->lid , name );
    14691468        }
    14701469
    1471         vfs_dmsg("\n[INFO] %s : found <%s> / core[%x,%d] / parent = %l / child = %l\n",
    1472         __FUNCTION__ , name , local_cxy , this->core->lid , parent_xp , child_xp );
     1470        vfs_dmsg("\n[INFO] %s : core[%x,%d] found <%s> / parent = %l / child = %l\n",
     1471        __FUNCTION__ , local_cxy , this->core->lid , name , parent_xp , child_xp );
    14731472
    14741473        // TODO check access rights here [AG]
     
    15191518    // implementation note:
    15201519    // we use two variables "index" and "count" because the buffer
    1521     // is actually written in decreasing index order (from leaf to root)
    1522     // TODO : handle conflict with a concurrent rename
    1523     // FIXME : handle synchro in the loop ... [AG]
     1520    // is written in decreasing index order (from leaf to root)
     1521    // TODO : handle conflict with a concurrent rename [AG]
     1522    // TODO : handle synchro in the loop [AG]
    15241523
    15251524        // set the NUL character in buffer / initialise buffer index and count
     
    16061605
    16071606        vfs_dmsg("\n[INFO] %s : dentry <%s> created in local cluster %x\n",
    1608                  __FUNCTION__ , name , local_cxy );
     1607        __FUNCTION__ , name , local_cxy );
    16091608    }
    16101609    else                               // parent cluster is remote
     
    16181617
    16191618        vfs_dmsg("\n[INFO] %s : dentry <%s> created in remote cluster %x\n",
    1620                  __FUNCTION__ , name , parent_cxy );
     1619        __FUNCTION__ , name , parent_cxy );
    16211620    }
    16221621                                     
     
    17081707    assert( (mapper != NULL) , __FUNCTION__ , "no mapper for page\n" );
    17091708
    1710     vfs_dmsg("\n[INFO] %s : enters for page %d in mapper / inode %l\n",
     1709    vfs_dmsg("\n[INFO] %s : enters for page %d in mapper / inode_xp %l\n",
    17111710    __FUNCTION__ , page->index , XPTR( local_cxy , &mapper->inode ) );
    17121711
     
    17541753    assert( (mapper != NULL) , __FUNCTION__ , "mapper pointer is NULL\n" );
    17551754
     1755    vfs_dmsg("\n[INFO] %s : core[%x,%d] enter for inode %l / cycle %d\n",
     1756    __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, XPTR(local_cxy , inode) );
     1757
     1758    // compute number of pages
    17561759    uint32_t npages = size >> CONFIG_PPM_PAGE_SHIFT;
    17571760    if( (size & CONFIG_PPM_PAGE_MASK) || (size == 0) ) npages++;
     
    17671770    }
    17681771
     1772    vfs_dmsg("\n[INFO] %s : core[%x,%d] exit for inode %l / cycle %d\n",
     1773    __FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, XPTR(local_cxy , inode) );
     1774
    17691775    return 0;
    17701776
Note: See TracChangeset for help on using the changeset viewer.