Changeset 9135
- Timestamp:
- 12/01/11 17:19:35 (19 months ago)
- Location:
- branches/Orange-Branch/src/client/usrint
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/Orange-Branch/src/client/usrint/ucache.c
r9134 r9135 181 181 inline struct mem_table_s *get_mtbl(uint16_t mtbl_blk, uint16_t mtbl_ent) 182 182 { 183 if( mtbl_blk >= 0 && 184 mtbl_blk < BLOCKS_IN_CACHE && 185 mtbl_ent >= 0 && 183 if( mtbl_blk < BLOCKS_IN_CACHE && 186 184 mtbl_ent < MEM_TABLE_ENTRY_COUNT) 187 185 { … … 206 204 int ucache_init_file_table(char forceCreation) 207 205 { 208 printf("file table initialized!\n");209 206 int i; 210 207 … … 285 282 { 286 283 uint16_t fentIndex = insert_file((uint32_t)*fs_id, (uint64_t)*handle); 287 if(fentIndex < 0 || fentIndex> FILE_TABLE_ENTRY_COUNT)284 if(fentIndex > FILE_TABLE_ENTRY_COUNT) 288 285 { 289 286 rc = -1; … … 297 294 } 298 295 296 /* 299 297 printf("%hu\t%hu\n", (*fent)->mtbl_blk, (*fent)->mtbl_ent); 300 298 fflush(stdout); 299 */ 301 300 302 301 mtbl = get_mtbl((*fent)->mtbl_blk, (*fent)->mtbl_ent); … … 762 761 #elif LOCK_TYPE == 1 763 762 rc = pthread_mutex_init(lock, NULL); 764 rc = pthread_mutex_unlock(lock);765 763 if(rc != 0) 766 764 { … … 949 947 static inline int init_memory_entry(struct mem_table_s *mtbl, int16_t index) 950 948 { 951 if(index > MEM_TABLE_ENTRY_COUNT || index == NIL16)949 if(index > MEM_TABLE_ENTRY_COUNT) 952 950 { 953 951 return -1; … … 1298 1296 current = &(ftbl->file[index]); 1299 1297 1300 unsigned char indexOccupied = (current->tag_handle == 0 && current->tag_id == 0);1298 unsigned char indexOccupied = (current->tag_handle != NIL64 && current->tag_id != NIL32); 1301 1299 //printf("indexOccupied? %c\n", indexOccupied); 1302 1300 -
branches/Orange-Branch/src/client/usrint/ucache.h
r9134 r9135 188 188 189 189 /* Lock Routines */ 190 ucache_lock_t *get_lock(uint16_t block_index);190 inline ucache_lock_t *get_lock(uint16_t block_index); 191 191 int lock_init(ucache_lock_t * lock); 192 192 inline int lock_lock(ucache_lock_t * lock);
