Main Page | Modules | Data Structures | File List | Data Fields | Globals

src/common/misc/tcache.c File Reference

Implementation of the Timeout Cache (tcache) component. More...

#include <assert.h>
#include "tcache.h"
#include "gossip.h"

Functions

int check_expiration (struct PINT_tcache *tcache, struct PINT_tcache_entry *entry, struct timeval *tv)
int tcache_lookup_oldest (struct PINT_tcache *tcache, struct PINT_tcache_entry **entry, int *status)
PINT_tcachePINT_tcache_initialize (int(*compare_key_entry)(void *key, struct qhash_head *link), int(*hash_key)(void *key, int table_size), int(*free_payload)(void *payload), int table_size)
void PINT_tcache_finalize (struct PINT_tcache *tcache)
int PINT_tcache_get_info (struct PINT_tcache *tcache, enum PINT_tcache_options option, unsigned int *arg)
int PINT_tcache_set_info (struct PINT_tcache *tcache, enum PINT_tcache_options option, unsigned int arg)
int PINT_tcache_insert_entry (struct PINT_tcache *tcache, void *key, void *payload, int *purged)
int PINT_tcache_lookup (struct PINT_tcache *tcache, void *key, struct PINT_tcache_entry **entry, int *status)
int PINT_tcache_reclaim (struct PINT_tcache *tcache, int *reclaimed)
int PINT_tcache_delete (struct PINT_tcache *tcache, struct PINT_tcache_entry *entry)
int PINT_tcache_refresh_entry (struct PINT_tcache *tcache, struct PINT_tcache_entry *entry)


Detailed Description

Implementation of the Timeout Cache (tcache) component.


Function Documentation

int check_expiration struct PINT_tcache tcache,
struct PINT_tcache_entry entry,
struct timeval *  tv
[static]
 

time interval to check expiration against

Parameters:
entry  tcached entry

int tcache_lookup_oldest struct PINT_tcache tcache,
struct PINT_tcache_entry **  entry,
int *  status
[static]
 

indicates if the entry is expired or not

Subsequent tcache function calls may destroy the entry and payload. Therefore the caller should copy the payload data if it intends to use it after another tcache function call.

Returns:
0 on success, -PVFS_error on failure
Parameters:
tcache  pointer to tcache instance
entry  tcache entry (output)
status  indicates if the entry is expired or not

Here is the call graph for this function:


Generated on Tue Feb 7 02:43:55 2012 for PVFS by doxygen 1.3.5