Changeset 437 for trunk/kernel/fs


Ignore:
Timestamp:
Mar 28, 2018, 2:40:29 PM (4 years ago)
Author:
alain
Message:

Fix various bugs

Location:
trunk/kernel/fs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/fs/devfs.c

    r435 r437  
    8585}
    8686
    87 ///////////////////////////////////////////////////
     87/////////////////////////////////////////////////
    8888void devfs_global_init( xptr_t   parent_inode_xp,
    8989                        xptr_t * devfs_dev_inode_xp,
     
    109109
    110110    assert( (error == 0) , __FUNCTION__ , "cannot create <dev>\n" );
     111
     112#if( CONFIG_DEBUG_DEVFS_INIT & 1 )
     113if( CONFIG_DEBUG_DEVFS_INIT < cycle )
     114printk("\n[DBG] %s : created <dev> inode at cycle %d\n", __FUNCTION__, cycle );
     115#endif
    111116
    112117    // create DEVFS "external" inode in cluster IO
  • trunk/kernel/fs/vfs.c

    r436 r437  
    33 *
    44 * Author  Mohamed Lamine Karaoui (2015)
    5  *         Alain Greiner (2016,2017)
     5 *         Alain Greiner (2016,2017,2018)
    66 *
    77 * Copyright (c) UPMC Sorbonne Universites
     
    455455    if( length >= CONFIG_VFS_MAX_NAME_LENGTH )
    456456    {
    457         printk("\n[ERROR] in %s : name too long\n", __FUNCTION__ );
     457
     458#if CONFIG_DEBUG_SYSCALLS_ERROR
     459printk("\n[ERROR] in %s : name <name> too long\n", __FUNCTION__ , name );
     460#endif
    458461        return EINVAL;
    459462    }
     
    467470    if( dentry == NULL )
    468471    {
    469         printk("\n[ERROR] in %s : cannot allocate dentry descriptor\n", __FUNCTION__ );
     472
     473#if CONFIG_DEBUG_SYSCALLS_ERROR
     474printk("\n[ERROR] in %s : cannot allocate dentry\n", __FUNCTION__ );
     475#endif
    470476        return ENOMEM;
    471477    }
     
    478484    strcpy( dentry->name , name );
    479485
     486#if( CONFIG_DEBUG_VFS_DENTRY_CREATE & 1 )
     487cycle = (uint32_t)hal_get_cycles();
     488if( CONFIG_DEBUG_VFS_DENTRY_CREATE < cycle )
     489printk("\n[DBG] %s : dentry initialised\n", __FUNCTION__ );
     490#endif
     491
    480492    // register dentry in hash table rooted in parent inode
    481493    xhtab_insert( XPTR( local_cxy , &parent->children ),
    482494                  name,
    483495                  XPTR( local_cxy , &dentry->list ) );
     496
     497#if( CONFIG_DEBUG_VFS_DENTRY_CREATE & 1 )
     498cycle = (uint32_t)hal_get_cycles();
     499if( CONFIG_DEBUG_VFS_DENTRY_CREATE < cycle )
     500printk("\n[DBG] %s : dentry registerd in htab\n", __FUNCTION__ );
     501#endif
    484502
    485503    // return extended pointer on dentry
     
    16371655
    16381656#if (CONFIG_DEBUG_VFS_ADD_CHILD & 1)
    1639 if( CONFIG_DEBUG_VFS_ADD_CHILD < cycle )
     1657if( (CONFIG_DEBUG_VFS_ADD_CHILD < cycle) && (error == 0) )
    16401658printk("\n[DBG] %s : dentry <%s> created in cluster %x\n", __FUNCTION__, name, local_cxy );
    16411659#endif
     
    16521670
    16531671#if (CONFIG_DEBUG_VFS_ADD_CHILD & 1)
    1654 if( CONFIG_DEBUG_VFS_ADD_CHILD < cycle )
     1672if( (CONFIG_DEBUG_VFS_ADD_CHILD < cycle) && (error == 0) )
    16551673printk("\n[DBG] %s : dentry <%s> created in cluster %x\n", __FUNCTION__, name, parent_cxy );
    16561674#endif
     
    16601678    if( error )
    16611679    {
    1662         printk("\n[ERROR] in %s : cannot create dentry in cluster %x\n",
    1663         __FUNCTION__ , parent_cxy );
     1680        printk("\n[ERROR] in %s : cannot create dentry <%s> in cluster %x\n",
     1681        __FUNCTION__ , name , parent_cxy );
    16641682        return ENOMEM;
    16651683    }
     
    16881706__FUNCTION__ , GET_PTR(inode_xp) , local_cxy );
    16891707#endif
    1690 
    1691 vfs_dmsg("\n[DBG] %s : inode %x created in local cluster %x\n",
    1692 __FUNCTION__ , GET_PTR(inode_xp) , local_cxy );
    16931708
    16941709    }
  • trunk/kernel/fs/vfs.h

    r430 r437  
    33 *
    44 * Author  Mohamed Lamine Karaoui (2014,2015)
    5  *         Alain Greiner (2016,2017)
     5 *         Alain Greiner (2016,2017,2018)
    66 *
    77 * Copyright (c) UPMC Sorbonne Universites
Note: See TracChangeset for help on using the changeset viewer.