Changeset 430 for trunk


Ignore:
Timestamp:
Jan 29, 2018, 6:10:17 PM (6 years ago)
Author:
alain
Message:

blop

Location:
trunk/kernel/fs
Files:
3 edited

Legend:

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

    r407 r430  
    387387    assert( ( size < CONFIG_TXT_KBUF_SIZE ) , __FUNCTION__ , "string size too large" );
    388388
    389     cxy_t              file_cxy;     // remote file descriptor cluster
    390     vfs_file_t       * file_ptr;     // remote file descriptor local pointer
    391     vfs_inode_type_t   inode_type;   // associated inode type
    392     vfs_inode_t      * inode_ptr;    // associated inode local pointer
     389    xptr_t             chdev_xp;
     390    cxy_t              chdev_cxy;
    393391    chdev_t          * chdev_ptr;    // associated chdev type
    394392    uint32_t           func;         // chdev functionnal type
     
    405403#endif
    406404
    407     // get cluster and local pointer on remote file descriptor
    408     // associated inode and chdev are stored in same cluster as the file desc.
    409     file_cxy  = GET_CXY( file_xp );
    410     file_ptr  = (vfs_file_t *)GET_PTR( file_xp );
    411 
    412     // get inode type from remote file descriptor
    413     inode_type = hal_remote_lw( XPTR( file_cxy , &file_ptr->type ) );
    414     inode_ptr  = (vfs_inode_t *)hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ) );
    415 
    416     assert( (inode_type == INODE_TYPE_DEV) , __FUNCTION__ ,
    417     "inode type is not INODE_TYPE_DEV" );
    418 
    419     // get chdev local pointer from remote inode extension
    420     chdev_ptr = (chdev_t *)hal_remote_lpt( XPTR( file_cxy , &inode_ptr->extend ) );
    421  
     405    // get extended pointer on chdev_xp
     406    chdev_xp = chdev_from_file( file_xp );
     407
     408    // get cluster and local pointer on chdev
     409    chdev_cxy  = GET_CXY( chdev_xp );
     410    chdev_ptr  = (chdev_t *)GET_PTR( chdev_xp );
     411
    422412    // get chdev functionnal type and channel
    423     func    = hal_remote_lw( XPTR( file_cxy , &chdev_ptr->func ) );
    424     channel = hal_remote_lw( XPTR( file_cxy , &chdev_ptr->channel ) );
     413    func    = hal_remote_lw( XPTR( chdev_cxy , &chdev_ptr->func ) );
     414    channel = hal_remote_lw( XPTR( chdev_cxy , &chdev_ptr->channel ) );
    425415
    426416    // action depends on "func" and "to_buffer"
     
    482472    else
    483473    {
    484         panic("device type %s does not support direct user access", chdev_func_str(func) );
     474        assert( false , __FUNCTION__ ,
     475        "%s does not support direct user access", chdev_func_str(func) );
    485476
    486477        return -1;
  • trunk/kernel/fs/vfs.c

    r409 r430  
    3535#include <slist.h>
    3636#include <xhtab.h>
     37#include <string.h>
    3738#include <rpc.h>
    3839#include <errno.h>
     
    166167    {
    167168        ctx = NULL;
    168                 panic("illegal file system type = %d" , fs_type );
     169                assert( false , __FUNCTION__ , "illegal file system type = %d\n" , fs_type );
    169170    }
    170171
     
    243244    if( inode->refcount )
    244245    {
    245         panic("inode refcount non zero");
     246        assert( false , __FUNCTION__ , "inode refcount non zero\n" );
    246247    }       
    247248
     
    425426    {
    426427        ctx = NULL;
    427         panic("undefined file system type");
     428        assert( false , __FUNCTION__ , "undefined file system type\n" );
    428429    }
    429430
     
    476477    if( dentry->refcount )
    477478    {
    478         panic("dentry refcount non zero");
     479        assert( false , __FUNCTION__ , "dentry refcount non zero\n" );
    479480    }       
    480481
     
    529530    if( file->refcount )
    530531    {
    531         panic("file refcount non zero");
     532        assert( false , __FUNCTION__ , "refcount non zero\n" );
    532533    }       
    533534
     
    883884                    char   * path )
    884885{
    885     panic("not implemented");
     886    assert( false , __FUNCTION__ , "not implemented\n" );
    886887    return 0;
    887888}
     
    891892                  struct stat * k_stat )
    892893{
    893     panic("not implemented");
     894    assert( false , __FUNCTION__ , "not implemented\n" );
    894895    return 0;
    895896}
     
    899900                     struct dirent * k_dirent )
    900901{
    901     panic("not implemented");
     902    assert( false , __FUNCTION__ , "not implemented\n" );
    902903    return 0;
    903904}
     
    908909                   uint32_t   mode )
    909910{
    910     panic("not implemented");
     911    assert( false , __FUNCTION__ , "not implemented\n" );
    911912    return 0;
    912913}
     
    916917                   char   * path )
    917918{
    918     panic("not implemented");
     919    assert( false , __FUNCTION__ , "not implemented\n" );
    919920    return 0;
    920921}
     
    952953    }
    953954
    954     panic("not fully implemented");
     955    assert( false , __FUNCTION__ , "not implemented\n" );
    955956    return 0;
    956957}
     
    984985
    985986   
    986     panic("not fully implemented");
     987    assert( false , __FUNCTION__ , "not implemented\n" );
    987988    return 0;
    988989}
     
    993994                    uint32_t rights )
    994995{
    995     panic("not implemented");
     996    assert( false , __FUNCTION__ , "not implemented\n" );
    996997    return 0;
    997998}
  • trunk/kernel/fs/vfs.h

    r409 r430  
    159159typedef enum   
    160160{
    161     INODE_TYPE_FILE  =     0x001,      /*! file                                          */
    162     INODE_TYPE_DIR   =     0x002,      /*! directory                                     */
    163     INODE_TYPE_FIFO  =     0x004,      /*! POSIX named pipe                              */
    164     INODE_TYPE_PIPE  =     0x008,      /*! POSIX anonymous pipe                          */
    165     INODE_TYPE_SOCK  =     0x010,      /*! POSIX socket                                  */
    166     INODE_TYPE_DEV   =     0x020,      /*! device channel                                */
    167     INODE_TYPE_SYML  =     0x080,      /*! symbolic link                                 */
     161    INODE_TYPE_FILE  =     0,           /*! file                                         */
     162    INODE_TYPE_DIR   =     1,           /*! directory                                    */
     163    INODE_TYPE_FIFO  =     2,           /*! POSIX named pipe                             */
     164    INODE_TYPE_PIPE  =     3,           /*! POSIX anonymous pipe                         */
     165    INODE_TYPE_SOCK  =     4,           /*! POSIX socket                                 */
     166    INODE_TYPE_DEV   =     5,           /*! device channel                               */
     167    INODE_TYPE_SYML  =     6,           /*! symbolic link                                */
    168168}
    169169vfs_inode_type_t;
Note: See TracChangeset for help on using the changeset viewer.