Ignore:
Timestamp:
Nov 19, 2020, 11:54:16 PM (4 years ago)
Author:
alain
Message:

Introduce the DEBUG_VFS_ERROR in kernel_config to make
error messges display conditional.

File:
1 edited

Legend:

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

    r657 r673  
    10981098    error_t    error;
    10991099
    1100 assert( (searched_page_id > first_page_id) ,
     1100assert( __FUNCTION__, (searched_page_id > first_page_id) ,
    11011101"searched_page_id must be larger than first_page_id\n");
    11021102
     
    12391239
    12401240// check arguments
    1241 assert( (mapper_xp != XPTR_NULL) , "mapper pointer is NULL\n" );
    1242 assert( (name      != NULL     ) , "child name is undefined\n" );
     1241assert( __FUNCTION__, (mapper_xp != XPTR_NULL) , "mapper pointer is NULL\n" );
     1242assert( __FUNCTION__, (name      != NULL     ) , "child name is undefined\n" );
    12431243
    12441244#if DEBUG_FATFS_SCAN_DIRECTORY
     
    18821882 
    18831883// check arguments
    1884 assert( (parent_inode_xp != XPTR_NULL) , "parent_inode_xp argument is NULL\n" );
    1885 assert( (dentry_ptr      != NULL)      , "dentry_ptr argument is NULL\n" );
     1884assert( __FUNCTION__, (parent_inode_xp != XPTR_NULL) , "parent_inode_xp argument is NULL\n" );
     1885assert( __FUNCTION__, (dentry_ptr      != NULL)      , "dentry_ptr argument is NULL\n" );
    18861886
    18871887    // get directory inode cluster and local pointer
     
    21532153                    else if (i == 11)                                // ATTR
    21542154                    {
    2155                         if (type == INODE_TYPE_DIR)  buf[i] = 0x10;
     2155                        if (type == FILE_TYPE_DIR)  buf[i] = 0x10;
    21562156                        else                         buf[i] = 0x20;
    21572157                    }
     
    22362236
    22372237// check arguments
    2238 assert( (parent_inode_xp != XPTR_NULL) , "parent_inode_xp argument is NULL\n" );
    2239 assert( (dentry_ptr      != NULL)      , "dentry_ptr argument is NULL\n" );
     2238assert( __FUNCTION__, (parent_inode_xp != XPTR_NULL) , "parent_inode_xp argument is NULL\n" );
     2239assert( __FUNCTION__, (dentry_ptr      != NULL)      , "dentry_ptr argument is NULL\n" );
    22402240
    22412241    // get directory inode cluster and local pointer
     
    23442344
    23452345// check for LFN entry
    2346 assert( (fatfs_get_remote_record( DIR_ATTR, base_xp + offset ) == ATTR_LONG_NAME_MASK ),
     2346assert( __FUNCTION__, (fatfs_get_remote_record( DIR_ATTR, base_xp + offset ) == ATTR_LONG_NAME_MASK ),
    23472347"this directory entry must be a LFN\n");
    23482348
     
    23952395
    23962396// check arguments
    2397 assert( (parent_inode_xp != XPTR_NULL)  , "parent_inode_xp is NULL\n" );
    2398 assert( (dentry_ptr      != NULL ) , "dentry_ptr is NULL\n" );
     2397assert( __FUNCTION__, (parent_inode_xp != XPTR_NULL)  , "parent_inode_xp is NULL\n" );
     2398assert( __FUNCTION__, (dentry_ptr      != NULL ) , "dentry_ptr is NULL\n" );
    23992399
    24002400    // get parent inode cluster and local pointer
     
    24452445
    24462446    // update the child inode "type", "size", and "extend" fields
    2447     vfs_inode_type_t type = (is_dir) ? INODE_TYPE_DIR : INODE_TYPE_FILE;
     2447    vfs_file_type_t type = (is_dir) ? FILE_TYPE_DIR : FILE_TYPE_REG;
    24482448
    24492449    hal_remote_s32( XPTR( child_cxy , &child_inode_ptr->type   ) , type );
     
    24862486
    24872487// check arguments
    2488 assert( (parent_inode_xp != XPTR_NULL) , "parent_inode_xp argument is NULL\n" );
    2489 assert( (dentry_ptr      != NULL)      , "dentry_ptr argument NULL\n" );
     2488assert( __FUNCTION__, (parent_inode_xp != XPTR_NULL) , "parent_inode_xp argument is NULL\n" );
     2489assert( __FUNCTION__, (dentry_ptr      != NULL)      , "dentry_ptr argument NULL\n" );
    24902490
    24912491    // get child inode cluster and local pointer
     
    25742574
    25752575// check arguments
    2576 assert( (parent_inode_xp  != XPTR_NULL) , "parent_inode_xp argument is NULL\n" );
    2577 assert( (dentry_ptr       != NULL)      , "dentry_ptr argument is NULL\n" );
     2576assert( __FUNCTION__, (parent_inode_xp  != XPTR_NULL) , "parent_inode_xp argument is NULL\n" );
     2577assert( __FUNCTION__, (dentry_ptr       != NULL)      , "dentry_ptr argument is NULL\n" );
    25782578
    25792579    // get parent directory cluster ans local pointer
     
    26802680
    26812681// check mapper pointer
    2682 assert( (mapper != NULL) , "mapper is NULL\n");
     2682assert( __FUNCTION__, (mapper != NULL) , "mapper is NULL\n");
    26832683   
    26842684// TODO handle the detailed flag
    2685 assert( (detailed == false), "detailed argument not supported/n");
     2685assert( __FUNCTION__, (detailed == false), "detailed argument not supported/n");
    26862686
    26872687    char       cname[CONFIG_VFS_MAX_NAME_LENGTH];  // name extracted from each dentry
     
    28292829
    28302830// check inode pointer and cluster index
    2831 assert( (inode_xp != XPTR_NULL)          , "inode pointer undefined\n" );
     2831assert( __FUNCTION__, (inode_xp != XPTR_NULL)          , "inode pointer undefined\n" );
    28322832
    28332833#if DEBUG_FATFS_SYNC_INODE
     
    28482848    mapper    = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->mapper ) );
    28492849
    2850 assert( (mapper != NULL) , "mapper pointer is NULL\n" );     
     2850assert( __FUNCTION__, (mapper != NULL) , "mapper pointer is NULL\n" );     
    28512851
    28522852    // get inode type and size
     
    28542854    type = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) );
    28552855
    2856 assert( (type == INODE_TYPE_FILE) , "inode is not a file\n" );     
     2856assert( __FUNCTION__, (type == FILE_TYPE_REG) , "inode is not a file\n" );     
    28572857
    28582858    // compute number of pages
     
    30093009
    30103010// check inode pointer
    3011 assert( (inode_xp != XPTR_NULL) , "inode pointer is NULL\n" );
     3011assert( __FUNCTION__, (inode_xp != XPTR_NULL) , "inode pointer is NULL\n" );
    30123012
    30133013    // get inode cluster and local pointer
     
    30203020
    30213021// check first cluster index
    3022 assert( (first_cluster_id != 0) , "inode extend is NULL\n" );
     3022assert( __FUNCTION__, (first_cluster_id != 0) , "inode extend is NULL\n" );
    30233023
    30243024#if DEBUG_FATFS_RELEASE_INODE
Note: See TracChangeset for help on using the changeset viewer.