Changeset 9025

Show
Ignore:
Timestamp:
08/23/11 15:40:35 (21 months ago)
Author:
jdenton
Message:

Integrating ucache with usrint (in progress):

Added a parameter to the pvfs_alloc_descriptor function in openfile-util:

the parameter is a pointer to a PVFS_object_ref.
the parameter can be NULL or it is used by the ucache to identify the file being inserted.

Added calls to ucache in openfile-util.c:

specifically in functions:

pvfs_alloc_descriptor
pvfs_free descriptor

ucache updates include the introduction of block level locks which may be needed

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

Legend:

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

    r9016 r9025  
    418418            struct stat sbuf; 
    419419            /* try to open using glibc */ 
    420             rc = (*glibc_ops.open)(error_path, flags & 01777777, mode); 
     420            rc = (*glibc_ops.open)(error_path, fpvfs_alloc_descriptorlags & 01777777, mode); 
    421421            IOCOMMON_RETURN_ERR(rc); 
    422             pd = pvfs_alloc_descriptor(&pvfs_ops, -1); 
     422            pd = pvfs_alloc_descriptor(&pvfs_ops, -1, NULL); 
    423423            pd->is_in_use = PVFS_FS;    /* indicate fd is valid! */ 
    424424            pd->true_fd = rc; 
     
    462462        } 
    463463    } 
     464 
    464465    /* If we get here the file was created and/or opened */ 
    465  
    466466    /* Translate the pvfs reference into a file descriptor */ 
    467467    /* Set the file information */ 
    468468    /* create fd object */ 
    469     pd = pvfs_alloc_descriptor(&pvfs_ops, -1); 
     469    pd = pvfs_alloc_descriptor(&pvfs_ops, -1, &file_ref); 
    470470    if (!pd) 
    471471    { 
     
    836836} 
    837837 
     838/*The Wrapper Fuction calls to the "nocache" version of  
     839 *  io_common_readorwrite (below)    
     840 */ 
     841/** do a blocking read or write, possibly utilizing the user cache. 
     842 *  
     843 */ 
     844int iocommon_readorwrite(enum PVFS_io_type which, 
     845                         pvfs_descriptor *pd, 
     846                         PVFS_size offset, 
     847                         void *buf, 
     848                         PVFS_Request mem_req, 
     849                         PVFS_Request file_req) 
     850{ 
     851    #ifndef UCACHE_ENABLED 
     852    /* No cache */ 
     853    return iocommon_readorwrite_nocache(which, pd, offset, buf, mem_req, 
     854                                                                file_req); 
     855    #endif /* UCACHE_ENABLED */ 
     856 
     857    //read 
     858    //readthedata(*filePtrToData) 
     859    //write 
     860 
     861 
     862    //Cache Routines 
     863    //Possibly Data Transfer 
     864    //Possibly More Cache Routines 
     865} 
     866 
    838867/** do a blocking read or write 
    839868 *  
    840869 */ 
    841 int iocommon_readorwrite(enum PVFS_io_type which, 
     870int iocommon_readorwrite_nocache(enum PVFS_io_type which, 
    842871                         pvfs_descriptor *pd, 
    843872                         PVFS_size offset, 
     
    886915} 
    887916 
     917/** Do a nonblocking read or write, possibly utilizing the user cache. 
     918 * 
     919 * extra_offset = extra padding to the pd's offset, 
     920 * independent of the pd's offset 
     921 * Returns an op_id, response, and ret_mem_request 
     922 * (which represents an etype_req*count region) 
     923 * Note that the none of the PVFS_Requests are freed 
     924 */ 
     925int iocommon_ireadorwrite(enum PVFS_io_type which, 
     926                          pvfs_descriptor *pd, 
     927                          PVFS_size extra_offset, 
     928                          void *buf, 
     929                          PVFS_Request etype_req, 
     930                          PVFS_Request file_req, 
     931                          size_t count, 
     932                          PVFS_sys_op_id *ret_op_id, 
     933                          PVFS_sysresp_io *ret_resp, 
     934                          PVFS_Request *ret_memory_req) 
     935{ 
     936    #ifndef UCACHE_ENABLED 
     937    /* No cache */ 
     938    return iocommon_ireadorwrite_nocache(which, pd, extra_offset, buf,  
     939        etype_req, file_req, count, ret_op_id, ret_resp, ret_memory_req); 
     940    #endif /* UCACHE_ENABLED */ 
     941 
     942    //if read then check cache..if not there..then read from i/o node and store into correct location 
     943    //Possibly Data Transfer 
     944    //Possibly More Cache Routines 
     945} 
     946 
     947 
    888948/** Do a nonblocking read or write 
    889949 * 
     
    894954 * Note that the none of the PVFS_Requests are freed 
    895955 */ 
    896 int iocommon_ireadorwrite(enum PVFS_io_type which, 
     956int iocommon_ireadorwrite_nocache(enum PVFS_io_type which, 
    897957                          pvfs_descriptor *pd, 
    898958                          PVFS_size extra_offset, 
     
    18391899} 
    18401900 
    1841 /** Implelments an extended attribute delete or remove 
     1901/** Implements an extended attribute delete or remove 
    18421902 * 
    18431903 *  The PVFS server enforces namespaces as prefixes on the 
  • branches/Orange-Branch/src/client/usrint/iocommon.h

    r9016 r9025  
    104104                    PVFS_object_ref *newpdir, const char *newname); 
    105105 
     106/* R/W Wrapper Functions, possibly utilizing user cache */ 
    106107/* do a blocking read or write 
    107  * extra_offset = extra padding to the pd's offset, independent of the pd's offset */ 
     108 */ 
    108109int iocommon_readorwrite(enum PVFS_io_type which, 
    109110                         pvfs_descriptor *pd, 
     
    112113                         PVFS_Request mem_req, 
    113114                         PVFS_Request file_req); 
    114         //returned by nonblocking operations 
    115  
    116 /* 
    117  * [Do a nonblocking read or write] 
    118  * extra_offset = extra padding to the pd's offset, 
    119  * independent of the pd's offset 
    120  * Returns an op_id, response, and ret_mem_request 
    121  * (which represents an etype_req*count region) 
    122  * Note that the none of the PVFS_Requests are freed 
    123  */ 
    124 int iocommon_ireadorwrite(enum PVFS_io_type which, 
     115 
     116 
     117/* [Do a nonblocking read or write] */ 
     118int iocommon_ireadorwrite_nocache(enum PVFS_io_type which, 
    125119                          pvfs_descriptor *pd, 
    126120                          PVFS_size extra_offset, 
     
    133127                          PVFS_Request *ret_memory_req); 
    134128 
     129 
     130/* do a blocking read or write 
     131 * extra_offset = extra padding to the pd's offset, independent of the pd's offset */ 
     132int iocommon_readorwrite_nocache(enum PVFS_io_type which, 
     133                         pvfs_descriptor *pd, 
     134                         PVFS_size offset, 
     135                         void *buf, 
     136                         PVFS_Request mem_req, 
     137                         PVFS_Request file_req); 
     138        //returned by nonblocking operations 
     139 
     140/* 
     141 * [Do a nonblocking read or write] 
     142 * extra_offset = extra padding to the pd's offset, 
     143 * independent of the pd's offset 
     144 * Returns an op_id, response, and ret_mem_request 
     145 * (which represents an etype_req*count region) 
     146 * Note that the none of the PVFS_Requests are freed 
     147 */ 
     148int iocommon_ireadorwrite_nocache(enum PVFS_io_type which, 
     149                          pvfs_descriptor *pd, 
     150                          PVFS_size extra_offset, 
     151                          void *buf, 
     152                          PVFS_Request etype_req, 
     153                          PVFS_Request file_req, 
     154                          size_t count, 
     155                          PVFS_sys_op_id *ret_op_id, 
     156                          PVFS_sysresp_io *ret_resp, 
     157                          PVFS_Request *ret_memory_req); 
     158 
    135159int iocommon_getattr(PVFS_object_ref obj, PVFS_sys_attr *attr, uint32_t mask); 
    136160 
  • branches/Orange-Branch/src/client/usrint/openfile-util.c

    r9016 r9025  
    1616#include <openfile-util.h> 
    1717#include <posix-pvfs.h> 
     18#include <ucache.h> 
    1819 
    1920static struct glibc_redirect_s 
     
    396397 * initialize fsops to the given set 
    397398 */ 
    398  pvfs_descriptor *pvfs_alloc_descriptor(posix_ops *fsops, int fd) 
     399 pvfs_descriptor *pvfs_alloc_descriptor(posix_ops *fsops, int fd,  
     400                                        PVFS_object_ref *file_ref 
     401 ) 
    399402 { 
    400403        int newfd, rc, flags;  
     
    443446        descriptor_table[newfd]->dpath = NULL; 
    444447        descriptor_table[newfd]->is_in_use = PVFS_FS; 
     448    descriptor_table[newfd]->mtbl = NULL; 
     449 
     450    /* File reference won't always be passed in */ 
     451    if(file_ref != NULL) 
     452    { 
     453        /* We have the file identifiers, so insert file info into ucache */ 
     454        rc = ucache_open_file(&(file_ref->fs_id), &(file_ref->handle),  
     455                                       descriptor_table[newfd]->mtbl); 
     456        /* Unique Entry */ 
     457        if(rc > 0) 
     458        {    
     459            descriptor_table[newfd]->mtbl->ref_cnt = 1; 
     460        } 
     461        /* File already in Cache */ 
     462        else if(rc == 0){ 
     463            descriptor_table[newfd]->mtbl->ref_cnt++; 
     464        } 
     465        /* Could not insert */ 
     466        else 
     467        { 
     468            /* TODO: probably need modify this */   
     469        } 
     470    } 
    445471 
    446472    return descriptor_table[newfd]; 
     
    519545            pd->fsops = &glibc_ops; 
    520546            pd->true_fd = fd; 
    521             pd->pvfs_ref.fs_id = 0; 
     547            pd->.fs_id = 0; 
    522548            pd->pvfs_ref.handle = 0; 
    523549            pd->flags = flags; 
     
    562588            free(pd->dpath); 
    563589        } 
    564         /* release cache opbjects here */ 
     590        /* release cache objects here */ 
     591        pd->mtbl->ref_cnt--; 
     592        if(pd->mtbl->ref_cnt == 0) 
     593        { 
     594            /* Flush dirty blocks before file removal from cache */ 
     595            ucache_flush(&(pd->pvfs_ref.fs_id), &(pd->pvfs_ref.handle)); 
     596            /* remove all of this file's associated data from cache */ 
     597            ucache_close_file(&(pd->pvfs_ref.fs_id), &(pd->pvfs_ref.handle)); 
     598        } 
     599 
    565600            /* free descriptor - wipe memory first */ 
    566601            memset(pd, 0, sizeof(pvfs_descriptor)); 
  • branches/Orange-Branch/src/client/usrint/openfile-util.h

    r9016 r9025  
    4444                            PVFS_object_ref *ref); 
    4545 
    46 pvfs_descriptor *pvfs_alloc_descriptor(posix_ops *fsops, int fd); 
     46pvfs_descriptor *pvfs_alloc_descriptor(posix_ops *fsops,  
     47                                                int fd,  
     48                                                PVFS_object_ref *file_ref); 
    4749 
    4850pvfs_descriptor *pvfs_find_descriptor(int fd); 
  • branches/Orange-Branch/src/client/usrint/posix-ops.h

    r9016 r9025  
    165165    int is_in_use;            /**< PVFS_FS if this descriptor is valid */ 
    166166    char *dpath;              /**< path of an open directory for fchdir */ 
     167    struct mem_table_s *mtbl; /**< reference to cached objects */             
    167168} pvfs_descriptor; 
    168169 
  • branches/Orange-Branch/src/client/usrint/posix.c

    r9016 r9025  
    6969        } 
    7070        /* set up the descriptor manually */ 
    71         pd = pvfs_alloc_descriptor(&glibc_ops, rc); 
     71        pd = pvfs_alloc_descriptor(&glibc_ops, rc, NULL); 
    7272        if (!pd) 
    7373        { 
  • branches/Orange-Branch/src/client/usrint/socket.c

    r9016 r9025  
    3030        return sockfd; 
    3131    } 
    32     pd = pvfs_alloc_descriptor(&glibc_ops, sockfd); 
     32    pd = pvfs_alloc_descriptor(&glibc_ops, sockfd, NULL); 
    3333    pd->mode |= S_IFSOCK; 
    3434    return pd->fd; 
     
    5959        goto errorout; 
    6060    } 
    61     pd = pvfs_alloc_descriptor(&glibc_ops, fd); 
     61    pd = pvfs_alloc_descriptor(&glibc_ops, fd , NULL); 
    6262    pd->mode |= S_IFSOCK; 
    6363    rc = fd;    
     
    436436        goto errorout; 
    437437    } 
    438     pd0 = pvfs_alloc_descriptor(&glibc_ops, sv[0]); 
     438    pd0 = pvfs_alloc_descriptor(&glibc_ops, sv[0], NULL); 
    439439    if (!pd0) 
    440440    { 
    441441        goto errorout; 
    442442    } 
    443     pd1 = pvfs_alloc_descriptor(&glibc_ops, sv[1]); 
     443    pd1 = pvfs_alloc_descriptor(&glibc_ops, sv[1], NULL); 
    444444    if (!pd1) 
    445445    { 
     
    473473        goto errorout; 
    474474    } 
    475     f0 = pvfs_alloc_descriptor(&glibc_ops, fa[0]); 
     475    f0 = pvfs_alloc_descriptor(&glibc_ops, fa[0], NULL); 
    476476    if (!f0) 
    477477    { 
    478478        goto errorout; 
    479479    } 
    480     f1 = pvfs_alloc_descriptor(&glibc_ops, fa[1]); 
     480    f1 = pvfs_alloc_descriptor(&glibc_ops, fa[1], NULL); 
    481481    if (!f1) 
    482482    { 
  • branches/Orange-Branch/src/client/usrint/ucache.c

    r9012 r9025  
    1818 
    1919/* Global Variables */ 
     20static FILE *out;                   /* For Logging Purposes */ 
     21 
    2022static union user_cache_u *ucache; 
    2123static int ucache_blk_cnt; 
    22 static ucache_lock_t *ucache_lock;  /* For maintaining concurrency */ 
    23 static FILE *out;                   /* For Logging Purposes */ 
     24 
     25static ucache_lock_t *ucache_locks; /* will refer to the shmem of all ucache locks */ 
     26static ucache_lock_t *ucache_lock;  /* Global Lock maintaining concurrency */ 
     27static ucache_lock_t *ucache_block_lock; 
    2428 
    2529/* Internal Only Function Declarations */ 
    2630 
    27 /* Global Cache Lock */ 
     31/* Locking */ 
    2832static int lock_init(ucache_lock_t * lock); 
    2933static int lock_lock(ucache_lock_t * lock); 
     
    112116void ucache_initialize(void) 
    113117{ 
    114     /* Aquire shared memory for ucache_lock */ 
    115     ucache_lock = shmat(shmget(ftok(GET_KEY_FILE, 'a'),  
    116         sizeof(ucache_lock_t), CACHE_FLAGS), NULL, AT_FLAGS); 
     118    int i = 0; 
     119 
     120    /* Aquire shared memory for ucache_locks */ 
     121    ucache_locks = shmat(shmget(ftok(GET_KEY_FILE, 'a'), (LOCK_SIZE  
     122           * (BLOCKS_IN_CACHE + 1)), CACHE_FLAGS), NULL, AT_FLAGS); 
     123    /* Global Cache lock stored in first LOCK_SIZE position */ 
     124    ucache_lock = ucache_locks;  
     125 
     126    /* Initialize Global Cache Lock */ 
    117127    lock_init(ucache_lock); 
    118128    lock_lock(ucache_lock); 
    119     #if LOCK_TYPE==0 
    120     int lockVal; 
    121     ucache_lock_getvalue(ucache_lock, &lockVal); 
    122     printf("lock value = %d\n", lockVal); 
    123     #endif 
    124     /* Aquire shared memory for lock for ucache */ 
    125     int key, id, i; 
     129 
     130    /* The next BLOCKS_IN_CACHE number of block locks follow the global lock */ 
     131    ucache_block_lock = ucache_locks + 1; 
     132    /* Initialize Block Level Locks */ 
     133    for(i = 0; i < BLOCKS_IN_CACHE; i++) 
     134    { 
     135        lock_init(get_block_lock(i)); 
     136    } 
     137 
     138    /* Aquire shared memory for ucache */ 
     139    int key; 
     140    int id; 
    126141    char *key_file_path; 
    127142    /*  Direct output   */ 
     
    172187} 
    173188 
    174 int ucache_open_file(PVFS_fs_id *fs_id, PVFS_object_ref *handle) 
     189int ucache_open_file(PVFS_fs_id *fs_id, PVFS_handle *handle,  
     190                                    struct mem_table_s *mtbl 
     191) 
     192{ 
     193    lock_lock(ucache_lock); 
     194    mtbl= lookup_file((uint32_t)(*fs_id), (uint64_t)(*handle), NULL, NULL, NULL, 
     195                                                                          NULL); 
     196    if((int)mtbl==NIL) 
     197    { 
     198        mtbl = insert_file((uint32_t)*fs_id, (uint64_t)*handle); 
     199        if((int)mtbl==NIL) 
     200        {   /* Error - Could not insert */ 
     201            lock_unlock(ucache_lock); 
     202            return -1; 
     203        } 
     204        else 
     205        { 
     206            /* File Inserted*/ 
     207            lock_unlock(ucache_lock); 
     208            return 1; 
     209        } 
     210    } 
     211    else 
     212    { 
     213        /* File was previously Inserted */ 
     214        lock_unlock(ucache_lock); 
     215        return 0; 
     216    } 
     217} 
     218 
     219/** Returns ptr to block in cache based on file and offset */ 
     220void *ucache_lookup(PVFS_fs_id *fs_id, PVFS_handle *handle, uint64_t offset) 
     221{ 
     222    lock_lock(ucache_lock); 
     223    struct mem_table_s *mtbl= lookup_file( 
     224        (uint32_t)(*fs_id), (uint64_t)(*handle), NULL, NULL, NULL, NULL); 
     225    if((int)mtbl!=NIL) 
     226    { 
     227        char *retVal = (char *)lookup_mem(mtbl, (uint64_t)offset, NULL, NULL,  
     228                                                                        NULL); 
     229        lock_unlock(ucache_lock); 
     230        return((void *)retVal);  
     231    } 
     232    lock_unlock(ucache_lock); 
     233    return (void *)NIL; 
     234} 
     235 
     236/** Prepares the data structures for block storage.  
     237 * On success, returns a pointer to where the block of data should be written.  
     238 * On failure, returns NIL. 
     239 */ 
     240void *ucache_insert(PVFS_fs_id *fs_id, PVFS_handle *handle, uint64_t offset) 
    175241{ 
    176242    lock_lock(ucache_lock); 
     
    179245    if((int)mtbl==NIL) 
    180246    { 
    181         insert_file((uint32_t)*fs_id, (uint64_t)*handle); 
    182     } 
    183     lock_unlock(ucache_lock); 
    184     return 1; 
    185 } 
    186  
    187 /** Returns ptr to block in cache based on file and offset */ 
    188 void *ucache_lookup(PVFS_fs_id *fs_id, PVFS_object_ref *handle, uint64_t offset) 
    189 { 
    190     lock_lock(ucache_lock); 
    191     struct mem_table_s *mtbl= lookup_file( 
    192         (uint32_t)(*fs_id), (uint64_t)(*handle), NULL, NULL, NULL, NULL); 
    193     if((int)mtbl!=NIL) 
    194     { 
    195         char *retVal = (char *)lookup_mem(mtbl, (uint64_t)offset, NULL, NULL,  
    196                                                                         NULL); 
    197         lock_unlock(ucache_lock); 
    198         return((void *)retVal);  
    199     } 
    200     lock_unlock(ucache_lock); 
    201     return (void *)NIL; 
    202 } 
    203  
    204 /** Prepares the data structures for block storage.  
    205  * On success, returns a pointer to where the block of data should be written.  
    206  * On failure, returns NIL. 
    207  */ 
    208 void *ucache_insert(PVFS_fs_id *fs_id, PVFS_object_ref *handle, uint64_t offset) 
    209 { 
    210     lock_lock(ucache_lock); 
    211     struct mem_table_s *mtbl= lookup_file( 
    212         (uint32_t)(*fs_id), (uint64_t)(*handle), NULL, NULL, NULL, NULL); 
    213     if((int)mtbl==NIL) 
    214     { 
    215247        lock_unlock(ucache_lock); 
    216248        return (void *)NIL; 
     
    229261 
    230262/**  Removes a cached block of data from mtbl */ 
    231 int ucache_remove(PVFS_fs_id *fs_id, PVFS_object_ref *handle, uint64_t offset) 
     263int ucache_remove(PVFS_fs_id *fs_id, PVFS_handle *handle, uint64_t offset) 
    232264{ 
    233265    lock_lock(ucache_lock); 
     
    245277 
    246278/** Flushes dirty blocks to the I/O Nodes */ 
    247 int ucache_flush(PVFS_fs_id *fs_id, PVFS_object_ref *handle) 
     279int ucache_flush(PVFS_fs_id *fs_id, PVFS_handle *handle) 
    248280{ 
    249281    lock_lock(ucache_lock); 
     
    273305 * the cache. 
    274306 */ 
    275 int ucache_close_file(PVFS_fs_id *fs_id, PVFS_object_ref *handle) 
     307int ucache_close_file(PVFS_fs_id *fs_id, PVFS_handle *handle) 
    276308{ 
    277309    lock_lock(ucache_lock); 
     
    474506    } 
    475507} 
     508 
     509/** Returns a pointer to the block level lock corresponding to the block_index. 
     510 */ 
     511ucache_lock_t * get_block_lock(int block_index) 
     512{ 
     513    return (ucache_block_lock + block_index); 
     514} 
     515 
    476516/***************************************** End of Externally Visible API */ 
    477517 
     
    522562 * Otherwise, returns -1 and sets errno. 
    523563 */ 
    524 #if LOCK_TYPE==0 
     564#if (LOCK_TYPE == 0) 
    525565int ucache_lock_getvalue(ucache_lock_t * lock, int *sval) 
    526566{ 
     
    534574static int lock_destroy(ucache_lock_t * lock) 
    535575{ 
    536     #if LOCK_TYPE==0 
     576    #if (LOCK_TYPE == 0) 
    537577    return sem_destroy(lock);  
    538     #elif LOCK_TYPE==1 
     578    #elif (LOCK_TYPE == 1) 
    539579    return pthread_mutex_destroy(lock); 
    540     #elif LOCK_TYPE==2 
     580    #elif (LOCK_TYPE == 2) 
    541581    return pthread_spin_destroy(lock); 
    542582    #endif 
  • branches/Orange-Branch/src/client/usrint/ucache.h

    r9012 r9025  
    4040#define NIL (-1) 
    4141 
    42 #define DBG 1 
     42#define DBG 0 
    4343#define INTERNAL_TESTING 0 
    4444 
    4545 
    46 #define LOCK_TYPE 0 /* 0 for Semaphore, 1 for Mutex, 2 for Spinlock */ 
    47 #if LOCK_TYPE==0 
     46#define LOCK_TYPE 1 /* 0 for Semaphore, 1 for Mutex, 2 for Spinlock */ 
     47#if (LOCK_TYPE == 0) 
    4848#define ucache_lock_t sem_t 
    49 #elif LOCK_TYPE==1 
    50 #define ucache_lock_t pthread_mutex_t 
    51 #elif LOCK_TYPE==2 
     49#define LOCK_SIZE sizeof(sem_t) 
     50#elif (LOCK_TYPE == 1) 
     51#define ucache_lock_t pthread_mutex_t /* sizeof(pthread_mutex_t)=24 */ 
     52#define LOCK_SIZE sizeof(pthread_mutex_t) 
     53#elif (LOCK_TYPE == 2) 
    5254#define ucache_lock_t pthread_spinlock_t 
     55#define LOCK_SIZE sizeof(pthread_spinlock_t) 
    5356#endif 
    5457 
    5558typedef uint32_t PVFS_fs_id; 
    56 typedef uint64_t PVFS_object_ref; 
     59typedef uint64_t PVFS_handle; 
    5760 
    5861/** A link for one block of memory in a files hash table 
     
    134137}; 
    135138 
     139struct ucache_ref_s 
     140{ 
     141    union user_cache_u *ucache;           /* pointer to ucache shmem */ 
     142    ucache_lock_t *ucache_locks;    /* pointer to ucache locks */ 
     143}; 
     144 
    136145/* externally visible API */ 
    137146void ucache_initialize(void); 
    138 int ucache_open_file(PVFS_fs_id *fs_id, PVFS_object_ref *handle); 
    139 void *ucache_lookup(PVFS_fs_id *fs_id, PVFS_object_ref *handle, uint64_t offset); 
    140 void *ucache_insert(PVFS_fs_id *fs_id, PVFS_object_ref *handle, uint64_t offset); 
    141 int ucache_remove(PVFS_fs_id *fs_id, PVFS_object_ref *handle, uint64_t offset); 
    142 int ucache_flush(PVFS_fs_id *fs_id, PVFS_object_ref *handle); 
    143 int ucache_close_file(PVFS_fs_id *fs_id, PVFS_object_ref *handle); 
     147int ucache_open_file(PVFS_fs_id *fs_id, PVFS_handle *handle,  
     148                                  struct mem_table_s *mtbl); 
     149int ucache_close_file(PVFS_fs_id *fs_id, PVFS_handle *handle); 
     150void *ucache_lookup(PVFS_fs_id *fs_id, PVFS_handle *handle, uint64_t offset); 
     151void *ucache_insert(PVFS_fs_id *fs_id, PVFS_handle *handle, uint64_t offset); 
     152int ucache_remove(PVFS_fs_id *fs_id, PVFS_handle *handle, uint64_t offset); 
     153int ucache_flush(PVFS_fs_id *fs_id, PVFS_handle *handle); 
    144154void ucache_dec_ref_cnt(struct mem_table_s * mtbl); 
    145155void ucache_inc_ref_cnt(struct mem_table_s * mtbl); 
     
    149159    ucache_lock_t * ucache_lock 
    150160); 
     161ucache_lock_t * get_block_lock(int block_index); 
    151162 
    152163#if LOCK_TYPE==0 
    153164int ucache_lock_getvalue(ucache_lock_t * lock, int *sval); 
    154 #endif 
     165#endif /* LOCK_TYPE */ 
    155166/****************************************  End of Internal Only Functions    */ 
    156 #endif 
     167#endif /* UCACHE_H */ 
    157168/* 
    158169 * Local variables: