nfs-ganesha 1.4
|
Functions | |
LRU_list_t * | LRU_Init (LRU_parameter_t lru_param, LRU_status_t *pstatus) |
int | LRU_invalidate (LRU_list_t *plru, LRU_entry_t *pentry) |
LRU_entry_t * | LRU_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) |
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.
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. |
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.
plru | Pointer to the list to be managed. |
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 .
lru_param | A structure of type lru_parameter_t which contains the values used to init the LRU. |
pstatus | Pointer to an integer to contain the status for the operation. |
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.
plru | Pointer to the list to be managed. |
pentry | Pointer to the entry to be tagged. |
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
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. |
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.
plru | Pointer to the list to be managed. |
pstatus | Pointer to an integer to contain the status for the operation. |
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.
plru | Pointer to the list to be managed. |
out_entry | the data pointed by the poped entry |
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).
plru | the LRU to be used. |
Definition at line 473 of file LRU_List.c.