Changeset 568 for trunk/kernel/fs/vfs.c
- Timestamp:
- Oct 5, 2018, 12:02:49 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/fs/vfs.c
r561 r568 28 28 #include <hal_atomic.h> 29 29 #include <hal_special.h> 30 #include <readlock.h>31 #include <spinlock.h>32 30 #include <printk.h> 33 31 #include <list.h> … … 43 41 #include <chdev.h> 44 42 #include <process.h> 43 #include <cluster.h> 45 44 #include <vfs.h> 46 45 #include <fatfs.h> … … 55 54 56 55 extern vfs_ctx_t fs_context[FS_TYPES_NR]; // allocated in kernel_init.c 57 58 56 extern chdev_directory_t chdev_dir; // allocated in kernel_init.c 57 extern char * lock_type_str[]; // allocated in kernel_init.c 59 58 60 59 ////////////////////////////////////////////////////////////////////////////////////////// … … 79 78 vfs_ctx->extend = extend; 80 79 81 spinlock_init( &vfs_ctx->lock);80 busylock_init( &vfs_ctx->lock , LOCK_VFS_CTX ); 82 81 83 82 bitmap_init( vfs_ctx->bitmap , BITMAP_SIZE(CONFIG_VFS_MAX_INODES) ); … … 89 88 { 90 89 // get lock on inum allocator 91 spinlock_lock( &ctx->lock );90 busylock_acquire( &ctx->lock ); 92 91 93 92 // get lid from local inum allocator … … 97 96 { 98 97 // release lock 99 spinlock_unlock( &ctx->lock );98 busylock_release( &ctx->lock ); 100 99 101 100 // return error … … 108 107 109 108 // release lock 110 spinlock_unlock( &ctx->lock );109 busylock_release( &ctx->lock ); 111 110 112 111 // return inum … … 160 159 161 160 #if DEBUG_VFS_INODE_CREATE 162 uint32_t cycle = (uint32_t)hal_get_cycles(); 161 char name[CONFIG_VFS_MAX_NAME_LENGTH]; 162 uint32_t cycle = (uint32_t)hal_get_cycles(); 163 cxy_t dentry_cxy = GET_CXY( dentry_xp ); 164 vfs_dentry_t * dentry_ptr = GET_PTR( dentry_xp ); 165 thread_t * this = CURRENT_THREAD; 166 if( dentry_xp != XPTR_NULL ) hal_remote_strcpy( XPTR( local_cxy , name ), 167 XPTR( dentry_cxy , dentry_ptr->name ) ); 168 else strcpy( name , "/" ); 163 169 if( DEBUG_VFS_INODE_CREATE < cycle ) 164 printk("\n[DBG] %s : thread %x enter / dentry = %x in cluster %x/ cycle %d\n",165 __FUNCTION__, CURRENT_THREAD, GET_PTR(dentry_xp), GET_CXY(dentry_xp), cycle );170 printk("\n[DBG] %s : thread %x in process %x enter for <%s> / cycle %d\n", 171 __FUNCTION__, this->trdid, this->process->pid, name, cycle ); 166 172 #endif 167 173 … … 232 238 xhtab_init( &inode->children , XHTAB_DENTRY_TYPE ); 233 239 234 // initialize inode locks 235 remote_rwlock_init( XPTR( local_cxy , &inode->data_lock ) ); 236 remote_spinlock_init( XPTR( local_cxy , &inode->main_lock ) ); 240 // initialize inode lock 241 remote_rwlock_init( XPTR( local_cxy , &inode->data_lock ), LOCK_VFS_INODE ); 242 243 // initialise lock protecting inode three traversal 244 remote_busylock_init( XPTR( local_cxy , &inode->main_lock ), LOCK_VFS_MAIN ); 237 245 238 246 #if DEBUG_VFS_INODE_CREATE 239 cycle = (uint32_t)hal_get_cycles();247 cycle = (uint32_t)hal_get_cycles(); 240 248 if( DEBUG_VFS_INODE_CREATE < cycle ) 241 printk("\n[DBG] %s : thread %x exit / inode = %x in cluster %x/ cycle %d\n",242 __FUNCTION__, CURRENT_THREAD, inode, local_cxy, cycle );249 printk("\n[DBG] %s : thread %x in process %x exit for <%s> / inode [%x,%x] / cycle %d\n", 250 __FUNCTION__, this->trdid, this->process->pid, name, local_cxy, inode, cycle ); 243 251 #endif 244 252 … … 346 354 347 355 // get size 348 remote_rwlock_rd_ lock( XPTR( cxy , &ptr->data_lock ) );349 uint32_t size = hal_remote_l w( XPTR( cxy , &ptr->size ) );350 remote_rwlock_rd_ unlock( XPTR( cxy , &ptr->data_lock ) );356 remote_rwlock_rd_acquire( XPTR( cxy , &ptr->data_lock ) ); 357 uint32_t size = hal_remote_l32( XPTR( cxy , &ptr->size ) ); 358 remote_rwlock_rd_release( XPTR( cxy , &ptr->data_lock ) ); 351 359 return size; 352 360 } … … 361 369 362 370 // set size 363 remote_rwlock_wr_ unlock( XPTR( cxy , &ptr->data_lock ) );364 hal_remote_s w( XPTR( cxy , &ptr->size ) , size );365 remote_rwlock_wr_ unlock( XPTR( cxy , &ptr->data_lock ) );371 remote_rwlock_wr_release( XPTR( cxy , &ptr->data_lock ) ); 372 hal_remote_s32( XPTR( cxy , &ptr->size ) , size ); 373 remote_rwlock_wr_release( XPTR( cxy , &ptr->data_lock ) ); 366 374 } 367 375 … … 374 382 375 383 // release the main lock 376 remote_ spinlock_unlock( XPTR( cxy , &ptr->main_lock ) );384 remote_busylock_release( XPTR( cxy , &ptr->main_lock ) ); 377 385 } 378 386 … … 385 393 386 394 // get the main lock 387 remote_ spinlock_lock( XPTR( cxy , &ptr->main_lock ) );395 remote_busylock_acquire( XPTR( cxy , &ptr->main_lock ) ); 388 396 } 389 397 … … 403 411 404 412 // get parent dentry 405 dentry_xp = hal_remote_l wd( XPTR( inode_cxy , &inode_ptr->parent_xp ) );413 dentry_xp = hal_remote_l64( XPTR( inode_cxy , &inode_ptr->parent_xp ) ); 406 414 407 415 // get local copy of name … … 475 483 cycle = (uint32_t)hal_get_cycles(); 476 484 if( DEBUG_VFS_DENTRY_CREATE < cycle ) 477 printk("\n[DBG] %s : dentry initialised\n", __FUNCTION__ ); 485 printk("\n[DBG] %s : thread %x in process %x / dentry <%s> initialised / cycle %d\n", 486 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, dentry->name, cycle ); 478 487 #endif 479 488 … … 488 497 cycle = (uint32_t)hal_get_cycles(); 489 498 if( DEBUG_VFS_DENTRY_CREATE < cycle ) 490 printk("\n[DBG] %s : dentry registerd in htab\n", __FUNCTION__ ); 499 printk("\n[DBG] %s : thread %x in process %x / dentry <%s> registered / cycle %d\n", 500 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, dentry->name, cycle ); 491 501 #endif 492 502 … … 544 554 vfs_file_t * file; 545 555 kmem_req_t req; 556 557 #if DEBUG_VFS_FILE_CREATE 558 uint32_t cycle = (uint32_t)hal_get_cycles(); 559 if( DEBUG_VFS_OPEN < cycle ) 560 printk("\n[DBG] %s : thread %x in process %x enter for inode %x in cluster %x / cycle %d\n", 561 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, inode, local_cxy, cycle ); 562 #endif 546 563 547 564 // allocate memory for new file descriptor … … 563 580 file->mapper = inode->mapper; 564 581 565 remote_rwlock_init( XPTR( local_cxy , &file->lock ) );582 remote_rwlock_init( XPTR( local_cxy , &file->lock ), LOCK_VFS_FILE ); 566 583 567 584 *file_xp = XPTR( local_cxy , file ); 568 585 569 #if DEBUG_VFS_ OPEN570 uint32_tcycle = (uint32_t)hal_get_cycles();586 #if DEBUG_VFS_FILE_CREATE 587 cycle = (uint32_t)hal_get_cycles(); 571 588 if( DEBUG_VFS_OPEN < cycle ) 572 589 printk("\n[DBG] %s : thread %x in process %x created file %x in cluster %x / cycle %d\n", … … 729 746 730 747 // get inode type from remote file descriptor 731 inode_type = hal_remote_l w( XPTR( file_cxy , &file_ptr->type ) );748 inode_type = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ) ); 732 749 733 750 assert( (inode_type == INODE_TYPE_FILE) , … … 735 752 736 753 // get mapper pointer and file offset from file descriptor 737 file_offset = hal_remote_l w( XPTR( file_cxy , &file_ptr->offset ) );754 file_offset = hal_remote_l32( XPTR( file_cxy , &file_ptr->offset ) ); 738 755 mapper = (mapper_t *)hal_remote_lpt( XPTR( file_cxy , &file_ptr->mapper ) ); 739 756 … … 784 801 785 802 // get inode type from remote file descriptor 786 inode_type = hal_remote_l w( XPTR( file_cxy , &file_ptr->type ) );803 inode_type = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ) ); 787 804 788 805 // action depends on inode type … … 790 807 { 791 808 // get mapper pointer and file offset from file descriptor 792 file_offset = hal_remote_l w( XPTR( file_cxy , &file_ptr->offset ) );809 file_offset = hal_remote_l32( XPTR( file_cxy , &file_ptr->offset ) ); 793 810 mapper = (mapper_t *)hal_remote_lpt( XPTR( file_cxy , &file_ptr->mapper ) ); 794 811 … … 848 865 849 866 // take file descriptor lock 850 remote_rwlock_wr_ lock( lock_xp );867 remote_rwlock_wr_acquire( lock_xp ); 851 868 852 869 if ( whence == SEEK_CUR ) // new = current + offset 853 870 { 854 new = hal_remote_l w( offset_xp ) + offset;871 new = hal_remote_l32( offset_xp ) + offset; 855 872 } 856 873 else if ( whence == SEEK_SET ) // new = offset … … 863 880 inode_ptr = (vfs_inode_t *)hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ) ); 864 881 865 new = hal_remote_l w( XPTR( file_cxy , &inode_ptr->size ) ) + offset;882 new = hal_remote_l32( XPTR( file_cxy , &inode_ptr->size ) ) + offset; 866 883 } 867 884 else 868 885 { 869 886 printk("\n[ERROR] in %s : illegal whence value\n", __FUNCTION__ ); 870 remote_rwlock_wr_ unlock( lock_xp );887 remote_rwlock_wr_release( lock_xp ); 871 888 return -1; 872 889 } 873 890 874 891 // set new offset 875 hal_remote_s w( offset_xp , new );892 hal_remote_s32( offset_xp , new ); 876 893 877 894 // release file descriptor lock 878 remote_rwlock_wr_ unlock( lock_xp );895 remote_rwlock_wr_release( lock_xp ); 879 896 880 897 // success … … 929 946 930 947 // take the lock protecting the list of copies 931 remote_ spinlock_lock( lock_xp );948 remote_queuelock_acquire( lock_xp ); 932 949 933 950 XLIST_FOREACH( root_xp , iter_xp ) … … 948 965 xptr_t entry_xp = XPTR( process_cxy , &process_ptr->fd_array.array[file_id] ); 949 966 950 // remote_rwlock_wr_ lock( fd_array_lock_xp );951 952 hal_remote_s wd( entry_xp , XPTR_NULL );967 // remote_rwlock_wr_acquire( fd_array_lock_xp ); 968 969 hal_remote_s64( entry_xp , XPTR_NULL ); 953 970 954 // remote_rwlock_wr_ unlock( fd_array_lock_xp );971 // remote_rwlock_wr_release( fd_array_lock_xp ); 955 972 956 973 vfs_file_count_down( file_xp ); … … 960 977 961 978 // release the lock protecting the list of copies 962 remote_ spinlock_unlock( lock_xp );979 remote_queuelock_release( lock_xp ); 963 980 964 981 #if (DEBUG_VFS_CLOSE & 1) … … 1064 1081 1065 1082 // get inode type from remote file 1066 inode_type = hal_remote_l w( XPTR( inode_cxy , &inode_ptr->type ) );1083 inode_type = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) ); 1067 1084 1068 1085 if( inode_type != INODE_TYPE_DIR ) … … 1072 1089 } 1073 1090 1074 assert( false , "not implemented\n" ); 1091 // TODO implement this function using process CWD lock 1092 1093 assert( false , "not implemented\n" ); 1094 1075 1095 return 0; 1076 1096 } … … 1101 1121 1102 1122 // get inode type from remote inode 1103 inode_type = hal_remote_l w( XPTR( inode_cxy , &inode_ptr->type ) );1123 inode_type = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) ); 1104 1124 1105 1125 … … 1123 1143 // Inode Tree functions 1124 1144 ////////////////////////////////////////////////////////////////////////////////////////// 1125 1126 1145 1127 1146 ////////////////////////////////////////////////////////////////////////// … … 1172 1191 1173 1192 // get inode type 1174 inode_type = hal_remote_l w( XPTR( inode_cxy , &inode_ptr->type ) );1193 inode_type = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) ); 1175 1194 1176 1195 // get local pointer on associated mapper … … 1192 1211 1193 1212 // get xhtab lock 1194 xhtab_ read_lock( children_xp );1213 xhtab_lock( children_xp ); 1195 1214 1196 1215 // get first dentry from xhtab … … 1204 1223 1205 1224 // get extended pointer on child inode 1206 child_inode_xp = hal_remote_l wd( XPTR( child_dentry_cxy,1225 child_inode_xp = hal_remote_l64( XPTR( child_dentry_cxy, 1207 1226 &child_dentry_ptr->child_xp ) ); 1208 1227 … … 1210 1229 child_dentry_name_xp = XPTR( child_dentry_cxy , &child_dentry_ptr->name ); 1211 1230 1212 // recursive call on child inode1231 // recursive call on inode display 1213 1232 vfs_recursive_display( child_inode_xp, 1214 1233 child_dentry_name_xp, … … 1220 1239 1221 1240 // release xhtab lock 1222 xhtab_ read_unlock( children_xp );1241 xhtab_unlock( children_xp ); 1223 1242 } 1224 1243 } // end vfs_recursive_display() … … 1231 1250 cxy_t dentry_cxy; 1232 1251 vfs_dentry_t * dentry_ptr; 1233 uint32_t save_sr;1234 1252 1235 1253 // get target inode cluster and local pointer … … 1238 1256 1239 1257 // get extended pointer on associated dentry 1240 dentry_xp = hal_remote_l wd( XPTR( inode_cxy , &inode_ptr->parent_xp ) );1258 dentry_xp = hal_remote_l64( XPTR( inode_cxy , &inode_ptr->parent_xp ) ); 1241 1259 1242 1260 // check if target inode is the File System root … … 1265 1283 1266 1284 // get TXT0 lock in busy waiting mode 1267 remote_ spinlock_lock_busy( lock_xp , &save_sr);1285 remote_busylock_acquire( lock_xp ); 1268 1286 1269 1287 // print header … … 1274 1292 1275 1293 // release lock 1276 remote_ spinlock_unlock_busy( lock_xp , save_sr);1294 remote_busylock_release( lock_xp ); 1277 1295 1278 1296 } // end vfs_display() … … 1298 1316 1299 1317 // get inode access mode, UID, and GID 1300 // TODO uint32_t mode = hal_remote_l w( XPTR( inode_cxy , &inode_ptr->mode ) );1301 uid_t uid = hal_remote_l w( XPTR( inode_cxy , &inode_ptr->uid ) );1302 gid_t gid = hal_remote_l w( XPTR( inode_cxy , &inode_ptr->gid ) );1318 // TODO uint32_t mode = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->mode ) ); 1319 uid_t uid = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->uid ) ); 1320 gid_t gid = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->gid ) ); 1303 1321 1304 1322 // FIXME : me must use mode … … 1342 1360 1343 1361 // return child inode 1344 *child_xp = (xptr_t)hal_remote_l wd( XPTR( dentry_cxy , &dentry_ptr->child_xp ) );1362 *child_xp = (xptr_t)hal_remote_l64( XPTR( dentry_cxy , &dentry_ptr->child_xp ) ); 1345 1363 return true; 1346 1364 … … 1496 1514 parent_ptr = GET_PTR( parent_xp ); 1497 1515 ctx_ptr = (vfs_ctx_t *)hal_remote_lpt( XPTR( parent_cxy,&parent_ptr->ctx ) ); 1498 fs_type = hal_remote_l w( XPTR( parent_cxy , &ctx_ptr->type ) );1516 fs_type = hal_remote_l32( XPTR( parent_cxy , &ctx_ptr->type ) ); 1499 1517 1500 1518 // select a cluster for missing inode … … 1545 1563 if( last && create && dir ) // new directory => update inode type 1546 1564 { 1547 hal_remote_s w( XPTR( child_cxy, &child_ptr->type ), INODE_TYPE_DIR );1565 hal_remote_s32( XPTR( child_cxy, &child_ptr->type ), INODE_TYPE_DIR ); 1548 1566 1549 1567 #if (DEBUG_VFS_LOOKUP & 1) … … 1555 1573 else if ( last && create ) // new file => update inode type 1556 1574 { 1557 hal_remote_s w( XPTR( child_cxy, &child_ptr->type ), INODE_TYPE_FILE );1575 hal_remote_s32( XPTR( child_cxy, &child_ptr->type ), INODE_TYPE_FILE ); 1558 1576 1559 1577 #if (DEBUG_VFS_LOOKUP & 1) … … 1574 1592 { 1575 1593 // load child mapper from device if child is a directory (prefetch) 1576 if( hal_remote_l w( XPTR( child_cxy , &child_ptr->type ) ) == INODE_TYPE_DIR )1594 if( hal_remote_l32( XPTR( child_cxy , &child_ptr->type ) ) == INODE_TYPE_DIR ) 1577 1595 { 1578 1596 if( child_cxy == local_cxy ) … … 1700 1718 1701 1719 // get extended pointer on parent dentry 1702 dentry_xp = (xptr_t)hal_remote_l wd( XPTR( inode_cxy , inode_ptr->parent_xp ) );1720 dentry_xp = (xptr_t)hal_remote_l64( XPTR( inode_cxy , inode_ptr->parent_xp ) ); 1703 1721 1704 1722 // get dentry cluster and local pointer … … 1707 1725 1708 1726 // get dentry name length and pointer 1709 length = hal_remote_l w( XPTR( dentry_cxy , &dentry_ptr->length ) );1727 length = hal_remote_l32( XPTR( dentry_cxy , &dentry_ptr->length ) ); 1710 1728 name = (char *)hal_remote_lpt( XPTR( dentry_cxy , &dentry_ptr->name ) ); 1711 1729 … … 1727 1745 1728 1746 // get extended pointer on next inode 1729 inode_xp = (xptr_t)hal_remote_l wd( XPTR( dentry_cxy , dentry_ptr->parent ) );1747 inode_xp = (xptr_t)hal_remote_l64( XPTR( dentry_cxy , dentry_ptr->parent ) ); 1730 1748 } 1731 1749 while( (dentry_xp != XPTR_NULL) ); … … 1757 1775 #if DEBUG_VFS_ADD_CHILD 1758 1776 uint32_t cycle = (uint32_t)hal_get_cycles(); 1777 thread_t * this = CURRENT_THREAD; 1759 1778 if( DEBUG_VFS_ADD_CHILD < cycle ) 1760 printk("\n[DBG] %s : thread %x enter for <%s> / child_cxy = %x / parent_cxy = %x / cycle %d\n", 1761 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, name, 1779 printk("\n[DBG] %s : thread %x in process %x enter for <%s>\n" 1780 " child_cxy = %x / parent_cxy = %x / cycle %d\n", 1781 __FUNCTION__, this->trdid, this->process->pid, name, 1762 1782 child_cxy, parent_cxy, (uint32_t)hal_get_cycles() ); 1763 1783 #endif … … 1770 1790 parent_ptr, 1771 1791 &dentry_xp ); 1772 1773 #if (DEBUG_VFS_ADD_CHILD & 1)1774 if( (DEBUG_VFS_ADD_CHILD < cycle) && (error == 0) )1775 printk("\n[DBG] %s : dentry <%s> created in cluster %x\n", __FUNCTION__, name, local_cxy );1776 #endif1777 1778 1792 } 1779 1793 else // parent cluster is remote … … 1785 1799 &dentry_xp, 1786 1800 &error ); 1787 1788 #if (DEBUG_VFS_ADD_CHILD & 1)1789 if( (DEBUG_VFS_ADD_CHILD < cycle) && (error == 0) )1790 printk("\n[DBG] %s : dentry <%s> created in cluster %x\n", __FUNCTION__, name, parent_cxy );1791 #endif1792 1793 1801 } 1794 1802 … … 1799 1807 return ENOMEM; 1800 1808 } 1809 1810 #if(DEBUG_VFS_ADD_CHILD & 1) 1811 if( DEBUG_VFS_ADD_CHILD < cycle ) 1812 printk("\n[DBG] %s : thread %x in process %x / dentry <%s> created in cluster %x\n", 1813 __FUNCTION__, this->trdid, this->process->pid, name, parent_cxy ); 1814 #endif 1801 1815 1802 1816 // 2. create child inode TODO : define attr / mode / uid / gid … … 1817 1831 gid, 1818 1832 &inode_xp ); 1819 1820 #if (DEBUG_VFS_ADD_CHILD & 1)1821 if( DEBUG_VFS_ADD_CHILD < cycle )1822 printk("\n[DBG] %s : inode <%x> created in cluster %x\n",1823 __FUNCTION__ , GET_PTR(inode_xp) , local_cxy );1824 #endif1825 1826 1833 } 1827 1834 else // child cluster is remote … … 1838 1845 &inode_xp, 1839 1846 &error ); 1840 1841 #if (DEBUG_VFS_ADD_CHILD & 1)1842 if( DEBUG_VFS_ADD_CHILD < cycle )1843 printk("\n[DBG] %s : inode <%s> created in cluster %x\n",1844 __FUNCTION__ , GET_PTR(inode_xp) , child_cxy );1845 #endif1846 1847 1847 } 1848 1848 … … 1858 1858 } 1859 1859 1860 #if(DEBUG_VFS_ADD_CHILD & 1) 1861 if( DEBUG_VFS_ADD_CHILD < cycle ) 1862 printk("\n[DBG] %s : thread %x in process %x / inode <%s> created in cluster %x\n", 1863 __FUNCTION__ , this->trdid, this->process->pid, name , child_cxy ); 1864 #endif 1865 1860 1866 // 3. update extended pointer on inode in dentry 1861 1867 cxy_t dentry_cxy = GET_CXY( dentry_xp ); 1862 1868 vfs_dentry_t * dentry_ptr = GET_PTR( dentry_xp ); 1863 hal_remote_s wd( XPTR( dentry_cxy , &dentry_ptr->child_xp ) , inode_xp );1869 hal_remote_s64( XPTR( dentry_cxy , &dentry_ptr->child_xp ) , inode_xp ); 1864 1870 1865 1871 #if DEBUG_VFS_ADD_CHILD 1866 1872 cycle = (uint32_t)hal_get_cycles(); 1867 1873 if( DEBUG_VFS_ADD_CHILD < cycle ) 1868 printk("\n[DBG] %s : thread %x in process %x exit for <%s> \n",1869 __FUNCTION__, CURRENT_THREAD, CURRENT_THREAD->process->pid, name);1874 printk("\n[DBG] %s : thread %x in process %x exit for <%s> / cycle %d\n", 1875 __FUNCTION__, this->trdid, this->process->pid, name, (uint32_t)hal_get_cycles() ); 1870 1876 #endif 1871 1877 … … 1893 1899 1894 1900 // get cluster and pointers of associated dentry 1895 dentry_xp = hal_remote_l wd( XPTR( inode_cxy , &inode_ptr->parent_xp ) );1901 dentry_xp = hal_remote_l64( XPTR( inode_cxy , &inode_ptr->parent_xp ) ); 1896 1902 dentry_cxy = GET_CXY( dentry_xp ); 1897 1903 dentry_ptr = GET_PTR( dentry_xp ); … … 1958 1964 if( fs_type == FS_TYPE_FATFS ) 1959 1965 { 1960 rwlock_wr_lock( &mapper->lock ); 1966 // enter mapper in write mode 1967 rwlock_wr_acquire( &mapper->lock ); 1968 1969 // move page to mapper 1961 1970 error = fatfs_mapper_move_page( page , to_mapper ); 1962 rwlock_wr_unlock( &mapper->lock ); 1971 1972 // exit mapper in write mode 1973 rwlock_wr_release( &mapper->lock ); 1963 1974 } 1964 1975 else if( fs_type == FS_TYPE_RAMFS )
Note: See TracChangeset
for help on using the changeset viewer.