Changeset 633 for trunk/kernel/fs


Ignore:
Timestamp:
May 28, 2019, 6:10:15 PM (5 years ago)
Author:
alain
Message:

cosmetic

Location:
trunk/kernel/fs
Files:
3 edited

Legend:

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

    r630 r633  
    25952595    fatfs_ctx_t * fatfs_ctx_ptr;  // local pointer on FATFS context in FAT cluster
    25962596    xptr_t        fat_mapper_xp;  // extended pointer on FAT mapper
    2597     mapper_t    * fat_mapper_ptr; // local pointer on FAT mapper
    25982597    xptr_t        lock_xp;        // extended pointer on lock protecting FAT.
    25992598    xptr_t        first_xp;       // extended pointer on inode extension
     
    26332632    loc_fatfs_ctx = vfs_ctx->extend;
    26342633
    2635     // get pointers on FAT mapper
     2634    // get FAT mapper cluster
    26362635    fat_mapper_xp  = loc_fatfs_ctx->fat_mapper_xp;
    26372636    fat_cxy        = GET_CXY( fat_mapper_xp );
    2638     fat_mapper_ptr = GET_PTR( fat_mapper_xp );
    26392637   
    26402638    // get pointers on FATFS context in FAT cluster
  • trunk/kernel/fs/vfs.c

    r630 r633  
    10211021    xptr_t        iter_xp;          // iterator on xlist
    10221022    mapper_t    * mapper_ptr;       // local pointer on associated mapper
    1023     xptr_t        mapper_xp;        // extended pointer on mapper
    10241023    vfs_inode_t * inode_ptr;        // local pointer on associated inode
    1025     xptr_t        inode_xp;         // extended pointer on inode
    10261024    uint32_t      size;             // current file size (from inode descriptor)
    10271025    error_t       error;
     
    10521050    //////// 1) update all dirty pages from mapper to device
    10531051
    1054     // get pointers on mapper associated to file
     1052    // get local pointer on mapper associated to file
    10551053    mapper_ptr = hal_remote_lpt( XPTR( file_cxy , &file_ptr->mapper ) );
    1056     mapper_xp  = XPTR( file_cxy , mapper_ptr );
    10571054
    10581055    // copy all dirty pages from mapper to device
     
    10831080    //////// 2) update file size in all parent directory mapper(s) and update device
    10841081
    1085     // get pointers on remote inode
     1082    // get local pointer on remote inode
    10861083    inode_ptr = hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ) );
    1087     inode_xp  = XPTR( file_cxy , inode_ptr );
    10881084
    10891085    // get file size from remote inode
     
    17011697    // build extended pointer on lock protecting Inode Tree (in VFS root inode)
    17021698    vfs_root_xp  = process->vfs_root_xp;
    1703     vfs_root_ptr = GET_PTR( root_xp );
    1704     vfs_root_cxy = GET_CXY( root_xp );
     1699    vfs_root_ptr = GET_PTR( vfs_root_xp );
     1700    vfs_root_cxy = GET_CXY( vfs_root_xp );
    17051701    lock_xp      = XPTR( vfs_root_cxy , &vfs_root_ptr->main_lock );
    17061702
     
    21082104    cxy_t             inode_cxy;    // inode cluster identifier       
    21092105    vfs_inode_t     * inode_ptr;    // inode local pointer
    2110     vfs_inode_type_t  inode_type;   // target inode type
    21112106
    21122107// check lookup working mode
     
    21272122   
    21282123    // get inode type from remote inode
    2129     inode_type = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) );
    2130 
    2131     // TODO implement this function
     2124    // inode_type = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) );
     2125
     2126    // TODO finalize implementation
    21322127
    21332128assert( false , "not implemented" );
     2129
     2130    // set inode rights in remote inode
     2131    hal_remote_s32( XPTR( inode_cxy , &inode_ptr->rights ) , rights );
    21342132
    21352133    return 0;
     
    24732471    bool_t             last;         // true when the name is the last in path
    24742472    bool_t             found;        // true when a child has been found
    2475     bool_t             dir;          // searched inode is a directory
    24762473    bool_t             create;       // searched inode must be created if not found
    24772474    bool_t             excl;         // searched inode must not exist
     
    24982495
    24992496    // compute lookup flags
    2500     dir    = (lookup_mode & VFS_LOOKUP_DIR)    == VFS_LOOKUP_DIR;
    25012497    create = (lookup_mode & VFS_LOOKUP_CREATE) == VFS_LOOKUP_CREATE;
    25022498    excl   = (lookup_mode & VFS_LOOKUP_EXCL)   == VFS_LOOKUP_EXCL;
     
    28792875    vfs_inode_t   * child_ptr;         // local pointer on child inode directory
    28802876    cxy_t           child_cxy;         // child inode directory cluster identifier
    2881     vfs_inode_t   * parent_ptr;        // local pointer on parent inode directory
    2882     cxy_t           parent_cxy;        // parent inode directory cluster identifier
    28832877    vfs_ctx_t     * ctx_ptr;           // local pointer on child inode FS context
    28842878    vfs_fs_type_t   fs_type;           // FS type of child inode
     
    29062900    child_cxy  = GET_CXY( child_xp );
    29072901    child_ptr  = GET_PTR( child_xp );
    2908 
    2909     // get parent directory cluster and local pointer
    2910     parent_cxy = GET_CXY( parent_xp );
    2911     parent_ptr = GET_PTR( parent_xp );
    29122902
    29132903    // get child inode FS type
     
    30523042
    30533043    // don't register <..> dentry in parent_inode xlist of parents
    3054     // parents_root_xp  = XPTR( parent_cxy , &parent_ptr->parents );
    3055     // parents_entry_xp = XPTR( child_cxy  , &dentry_ptr->parents );
    3056     // xlist_add_first( parents_root_xp , parents_entry_xp );
    3057     // hal_remote_atomic_add( XPTR( parent_cxy , &parent_ptr->links ) , 1 );
    30583044
    30593045    // update "parent" and "child_xp" fields in <..> dentry
     
    33693355#if(DEBUG_VFS_ADD_CHILD & 1)
    33703356if( DEBUG_VFS_ADD_CHILD < cycle )
    3371 printk("\n[%s] thread[%x,%x] / dentry (%x,%x) registered in child inode (%x,%x)\n",
     3357printk("\n[%s] thread[%x,%x] link dentry(%x,%x) to child inode(%x,%x)\n",
    33723358__FUNCTION__, this->process->pid, this->trdid,
    33733359parent_cxy, new_dentry_ptr, child_cxy, new_inode_ptr );
     
    33813367#if(DEBUG_VFS_ADD_CHILD & 1)
    33823368if( DEBUG_VFS_ADD_CHILD < cycle )
    3383 printk("\n[%s] thread[%x,%x] / dentry (%x,%x) registered in parent inode (%x,%x)\n",
     3369printk("\n[%s] thread[%x,%x] link dentry(%x,%x) to parent inode(%x,%x)\n",
    33843370__FUNCTION__, this->process->pid, this->trdid,
    33853371parent_cxy, new_dentry_ptr, parent_cxy, parent_inode_ptr );
     
    33943380if( DEBUG_VFS_ADD_CHILD < cycle )
    33953381printk("\n[%s] thread[%x,%x] exit for <%s> / cycle %d\n",
    3396 __FUNCTION__, this->process->pid, this->trdid, name, (uint32_t)hal_get_cycles() );
     3382__FUNCTION__, this->process->pid, this->trdid, name, cycle );
    33973383#endif
    33983384
  • trunk/kernel/fs/vfs.h

    r626 r633  
    153153typedef struct vfs_inode_s
    154154{
    155         struct vfs_ctx_s * ctx;              /*! local pointer on FS context                 */
    156         uint32_t           inum;             /*! inode identifier (unique in file system)    */
    157         uint32_t           attr;             /*! inode attributes (see above)                */
    158         vfs_inode_type_t   type;             /*! inode type (see above)                      */
    159         uint32_t           size;             /*! number of bytes                             */
    160         uint32_t           uid;              /*! user owner identifier                       */
    161         uint32_t           gid;              /*! group owner identifier                      */
     155    struct vfs_ctx_s * ctx;              /*! local pointer on FS context                 */
     156    uint32_t           inum;             /*! inode identifier (unique in file system)    */
     157    uint32_t           attr;             /*! inode attributes (see above)                */
     158    vfs_inode_type_t   type;             /*! inode type (see above)                      */
     159    uint32_t           size;             /*! number of bytes                             */
     160    uint32_t           uid;              /*! user owner identifier                       */
     161    uint32_t           gid;              /*! group owner identifier                      */
    162162    uint32_t           rights;           /*! access rights                               */
    163         xlist_entry_t      parents;          /*! root of list of parents dentries            */
    164         uint32_t           links;            /*! number of parent dentries (hard links)      */
    165         xhtab_t            children;         /*! embedded xhtab of children dentries         */
    166         remote_rwlock_t    size_lock;        /*! protect read/write to size                  */
    167         remote_rwlock_t    main_lock;        /*! protect inode tree traversal and modifs     */
    168         struct mapper_s  * mapper;           /*! associated file cache                       */
    169         void             * extend;           /*! fs_type_specific inode extension            */
     163    xlist_entry_t      parents;          /*! root of list of parents dentries            */
     164    uint32_t           links;            /*! number of parent dentries (hard links)      */
     165    xhtab_t            children;         /*! embedded xhtab of children dentries         */
     166    remote_rwlock_t    size_lock;        /*! protect read/write to size                  */
     167    remote_rwlock_t    main_lock;        /*! protect inode tree traversal and modifs     */
     168    struct mapper_s  * mapper;           /*! associated file cache                       */
     169    void             * extend;           /*! fs_type_specific inode extension            */
    170170}
    171171vfs_inode_t;
Note: See TracChangeset for help on using the changeset viewer.