nfs-ganesha 1.4
Functions

LRUExportedFunctions

Functions

LRU_list_tLRU_Init (LRU_parameter_t lru_param, LRU_status_t *pstatus)
int LRU_invalidate (LRU_list_t *plru, LRU_entry_t *pentry)
LRU_entry_tLRU_new_entry (LRU_list_t *plru, LRU_status_t *pstatus)
int LRU_pop_entry (LRU_list_t *plru, LRU_entry_t *out_entry)
int LRU_gc_invalid (LRU_list_t *plru, void *cleanparam)
int LRU_invalidate_by_function (LRU_list_t *plru, int(*testfunc)(LRU_entry_t *, void *addparam), void *addparam)
int LRU_apply_function (LRU_list_t *plru, int(*myfunc)(LRU_entry_t *, void *addparam), void *addparam)
void LRU_Print (LRU_list_t *plru)

Function Documentation

int LRU_apply_function ( LRU_list_t plru,
int(*)(LRU_entry_t *, void *addparam)  myfunc,
void *  addparam 
)

LRU_apply_function: apply the same function to every LRU entry, but do not change their states.

apply the same function to every LRU entry, but do not change their states.

Parameters:
plru[INOUT] LRU list to be managed.
myfunc[IN] function used to be runned on every entry. If this function return FALSE, the loop stops.
addparam[IN] parameter for the input function.
Returns:
LRU_LIST_SUCCESS if ok, other values shows an error
See also:
LRU_invalidate
LRU_gc_invalid

Definition at line 426 of file LRU_List.c.

int LRU_gc_invalid ( LRU_list_t plru,
void *  cleanparam 
)

LRU_gc_invalid : garbagge collection for invalid entries.

Read the whole LRU list and put the invalid entries back to the pool.

Parameters:
plruPointer to the list to be managed.
Returns:
An integer to contain the status for the operation.
See also:
LRU_invalidate

Definition at line 307 of file LRU_List.c.

LRU_list_t* LRU_Init ( LRU_parameter_t  lru_param,
LRU_status_t pstatus 
)

LRU_Init: Init the LRU list.

Init the Hash Table .

Parameters:
lru_paramA structure of type lru_parameter_t which contains the values used to init the LRU.
pstatusPointer to an integer to contain the status for the operation.
Returns:
NULL if init failed, the pointeur to the hashtable otherwise.
See also:
PreAllocEntry

Definition at line 136 of file LRU_List.c.

int LRU_invalidate ( LRU_list_t plru,
LRU_entry_t pentry 
)

LRU_invalidate: Tag an entry as invalid.

Tag an entry as invalid, this kind of entry will be put off the LRU (and sent back to the pool) when a garbagge collection will be performed.

Parameters:
plruPointer to the list to be managed.
pentryPointer to the entry to be tagged.
Returns:
LRU_LIST_SUCCESS if successfull, other values show an error.
See also:
LRU_gc_invalid

Definition at line 186 of file LRU_List.c.

int LRU_invalidate_by_function ( LRU_list_t plru,
int(*)(LRU_entry_t *, void *addparam)  testfunc,
void *  addparam 
)

LRU_invalidate_by_function: Browse the lru to test if entries should ne invalidated.

Browse the lru to test if entries should ne invalidated. This function is used for garbagge collection

Parameters:
plru[INOUT] LRU list to be managed.
testfunc[IN] function used to identify an entry to be tagged invalid. This function returns TRUE if entry will be tagged invalid
addparam[IN] parameter for the input function.
Returns:
LRU_LIST_SUCCESS if ok, other values shows an error
See also:
LRU_invalidate
LRU_gc_invalid

Definition at line 369 of file LRU_List.c.

LRU_entry_t* LRU_new_entry ( LRU_list_t plru,
LRU_status_t pstatus 
)

LRU_new_entry : acquire a new entry from the pool.

acquire a new entry from the pool. If pool is empty, a new chunck is added to complete the operation.

Parameters:
plruPointer to the list to be managed.
pstatusPointer to an integer to contain the status for the operation.
Returns:
NULL if init failed, the pointeur to the hashtable otherwise.
See also:
PreAllocEntry

Definition at line 210 of file LRU_List.c.

int LRU_pop_entry ( LRU_list_t plru,
LRU_entry_t out_entry 
)

LRU_pop_entry : pop the entry at the head of the list, returning the data it points to.

Parameters:
plruPointer to the list to be managed.
out_entrythe data pointed by the poped entry
Returns:
a status indicating whether the LRU is empty (hence cannot pop an item) or otherwise pop succeeded. when successfull, the LRU data is returned.

Definition at line 282 of file LRU_List.c.

void LRU_Print ( LRU_list_t plru)

LRU_Print: Print information about the LRU (mostly for debugging purpose).

Print information about the LRU (mostly for debugging purpose).

Parameters:
plruthe LRU to be used.
Returns:
none (returns void).

Definition at line 473 of file LRU_List.c.