Changeset 9135

Show
Ignore:
Timestamp:
12/01/11 17:19:35 (19 months ago)
Author:
jdenton
Message:

Fixed bug that was causing inserted files to not be chained in hash table. Chaining works now.
Corrected some compilation warnings.

Location:
branches/Orange-Branch/src/client/usrint
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/Orange-Branch/src/client/usrint/ucache.c

    r9134 r9135  
    181181inline struct mem_table_s *get_mtbl(uint16_t mtbl_blk, uint16_t mtbl_ent) 
    182182{ 
    183     if( mtbl_blk >= 0 &&  
    184         mtbl_blk < BLOCKS_IN_CACHE && 
    185         mtbl_ent >= 0 &&  
     183    if( mtbl_blk < BLOCKS_IN_CACHE && 
    186184        mtbl_ent < MEM_TABLE_ENTRY_COUNT) 
    187185    { 
     
    206204int ucache_init_file_table(char forceCreation) 
    207205{ 
    208     printf("file table initialized!\n"); 
    209206    int i; 
    210207 
     
    285282    { 
    286283        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) 
    288285        { 
    289286            rc = -1; 
     
    297294        } 
    298295 
     296        /* 
    299297        printf("%hu\t%hu\n", (*fent)->mtbl_blk, (*fent)->mtbl_ent); 
    300298        fflush(stdout); 
     299        */ 
    301300 
    302301        mtbl = get_mtbl((*fent)->mtbl_blk, (*fent)->mtbl_ent); 
     
    762761    #elif LOCK_TYPE == 1 
    763762    rc = pthread_mutex_init(lock, NULL); 
    764     rc = pthread_mutex_unlock(lock); 
    765763    if(rc != 0) 
    766764    { 
     
    949947static inline int init_memory_entry(struct mem_table_s *mtbl, int16_t index) 
    950948{ 
    951         if(index > MEM_TABLE_ENTRY_COUNT || index == NIL16) 
     949        if(index > MEM_TABLE_ENTRY_COUNT) 
    952950        { 
    953951            return -1; 
     
    12981296    current = &(ftbl->file[index]); 
    12991297 
    1300     unsigned char indexOccupied = (current->tag_handle == 0 && current->tag_id == 0); 
     1298    unsigned char indexOccupied = (current->tag_handle != NIL64 && current->tag_id != NIL32); 
    13011299    //printf("indexOccupied? %c\n", indexOccupied); 
    13021300 
  • branches/Orange-Branch/src/client/usrint/ucache.h

    r9134 r9135  
    188188 
    189189/* Lock Routines */ 
    190 ucache_lock_t *get_lock(uint16_t block_index); 
     190inline ucache_lock_t *get_lock(uint16_t block_index); 
    191191int lock_init(ucache_lock_t * lock); 
    192192inline int lock_lock(ucache_lock_t * lock);