Changeset 633 for trunk/kernel/fs/vfs.c
- Timestamp:
- May 28, 2019, 6:10:15 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/fs/vfs.c
r630 r633 1021 1021 xptr_t iter_xp; // iterator on xlist 1022 1022 mapper_t * mapper_ptr; // local pointer on associated mapper 1023 xptr_t mapper_xp; // extended pointer on mapper1024 1023 vfs_inode_t * inode_ptr; // local pointer on associated inode 1025 xptr_t inode_xp; // extended pointer on inode1026 1024 uint32_t size; // current file size (from inode descriptor) 1027 1025 error_t error; … … 1052 1050 //////// 1) update all dirty pages from mapper to device 1053 1051 1054 // get pointerson mapper associated to file1052 // get local pointer on mapper associated to file 1055 1053 mapper_ptr = hal_remote_lpt( XPTR( file_cxy , &file_ptr->mapper ) ); 1056 mapper_xp = XPTR( file_cxy , mapper_ptr );1057 1054 1058 1055 // copy all dirty pages from mapper to device … … 1083 1080 //////// 2) update file size in all parent directory mapper(s) and update device 1084 1081 1085 // get pointerson remote inode1082 // get local pointer on remote inode 1086 1083 inode_ptr = hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ) ); 1087 inode_xp = XPTR( file_cxy , inode_ptr );1088 1084 1089 1085 // get file size from remote inode … … 1701 1697 // build extended pointer on lock protecting Inode Tree (in VFS root inode) 1702 1698 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 ); 1705 1701 lock_xp = XPTR( vfs_root_cxy , &vfs_root_ptr->main_lock ); 1706 1702 … … 2108 2104 cxy_t inode_cxy; // inode cluster identifier 2109 2105 vfs_inode_t * inode_ptr; // inode local pointer 2110 vfs_inode_type_t inode_type; // target inode type2111 2106 2112 2107 // check lookup working mode … … 2127 2122 2128 2123 // get inode type from remote inode 2129 inode_type = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) );2130 2131 // TODO implement this function2124 // inode_type = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) ); 2125 2126 // TODO finalize implementation 2132 2127 2133 2128 assert( false , "not implemented" ); 2129 2130 // set inode rights in remote inode 2131 hal_remote_s32( XPTR( inode_cxy , &inode_ptr->rights ) , rights ); 2134 2132 2135 2133 return 0; … … 2473 2471 bool_t last; // true when the name is the last in path 2474 2472 bool_t found; // true when a child has been found 2475 bool_t dir; // searched inode is a directory2476 2473 bool_t create; // searched inode must be created if not found 2477 2474 bool_t excl; // searched inode must not exist … … 2498 2495 2499 2496 // compute lookup flags 2500 dir = (lookup_mode & VFS_LOOKUP_DIR) == VFS_LOOKUP_DIR;2501 2497 create = (lookup_mode & VFS_LOOKUP_CREATE) == VFS_LOOKUP_CREATE; 2502 2498 excl = (lookup_mode & VFS_LOOKUP_EXCL) == VFS_LOOKUP_EXCL; … … 2879 2875 vfs_inode_t * child_ptr; // local pointer on child inode directory 2880 2876 cxy_t child_cxy; // child inode directory cluster identifier 2881 vfs_inode_t * parent_ptr; // local pointer on parent inode directory2882 cxy_t parent_cxy; // parent inode directory cluster identifier2883 2877 vfs_ctx_t * ctx_ptr; // local pointer on child inode FS context 2884 2878 vfs_fs_type_t fs_type; // FS type of child inode … … 2906 2900 child_cxy = GET_CXY( child_xp ); 2907 2901 child_ptr = GET_PTR( child_xp ); 2908 2909 // get parent directory cluster and local pointer2910 parent_cxy = GET_CXY( parent_xp );2911 parent_ptr = GET_PTR( parent_xp );2912 2902 2913 2903 // get child inode FS type … … 3052 3042 3053 3043 // 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 );3058 3044 3059 3045 // update "parent" and "child_xp" fields in <..> dentry … … 3369 3355 #if(DEBUG_VFS_ADD_CHILD & 1) 3370 3356 if( DEBUG_VFS_ADD_CHILD < cycle ) 3371 printk("\n[%s] thread[%x,%x] / dentry (%x,%x) registered in child inode(%x,%x)\n",3357 printk("\n[%s] thread[%x,%x] link dentry(%x,%x) to child inode(%x,%x)\n", 3372 3358 __FUNCTION__, this->process->pid, this->trdid, 3373 3359 parent_cxy, new_dentry_ptr, child_cxy, new_inode_ptr ); … … 3381 3367 #if(DEBUG_VFS_ADD_CHILD & 1) 3382 3368 if( DEBUG_VFS_ADD_CHILD < cycle ) 3383 printk("\n[%s] thread[%x,%x] / dentry (%x,%x) registered in parent inode(%x,%x)\n",3369 printk("\n[%s] thread[%x,%x] link dentry(%x,%x) to parent inode(%x,%x)\n", 3384 3370 __FUNCTION__, this->process->pid, this->trdid, 3385 3371 parent_cxy, new_dentry_ptr, parent_cxy, parent_inode_ptr ); … … 3394 3380 if( DEBUG_VFS_ADD_CHILD < cycle ) 3395 3381 printk("\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 ); 3397 3383 #endif 3398 3384
Note: See TracChangeset
for help on using the changeset viewer.