nfs-ganesha 1.4
|
#include "ganesha_rpc.h"
#include "HashData.h"
#include "HashTable.h"
#include "nfs_core.h"
#include "nfs23.h"
#include "nfs4.h"
#include "fsal.h"
#include "nfs_tools.h"
Go to the source code of this file.
Prototypes for duplicate requsts cache management.
Definition in file nfs_dupreq.h.
typedef struct dupreq_entry__ dupreq_entry_t |
typedef struct dupreq_key__ dupreq_key_t |
typedef enum dupreq_status dupreq_status_t |
enum dupreq_status |
DUPREQ_SUCCESS | |
DUPREQ_INSERT_MALLOC_ERROR | |
DUPREQ_NOT_FOUND | |
DUPREQ_BEING_PROCESSED | |
DUPREQ_ALREADY_EXISTS |
Definition at line 107 of file nfs_dupreq.h.
int clean_entry_dupreq | ( | LRU_entry_t * | pentry, |
void * | addparam | ||
) |
clean_entry_dupreq: cleans an entry in the dupreq cache.
cleans an entry in the dupreq cache.
pentry | [INOUT] entry to be cleaned. |
addparam | [IN] additional parameter used for cleaning. |
Definition at line 295 of file nfs_dupreq.c.
int compare_req | ( | hash_buffer_t * | buff1, |
hash_buffer_t * | buff2 | ||
) |
compare_req: compares the xid, ip, and port stored in the key buffers. may also compare the checksum if the relevant option was enabled during compile.
compare the xid, ip, and port stored in the key buffers. This function is to be used as 'compare_key' field in the hashtable storing the nfs duplicated requests.
buff1 | [IN] first key |
buff2 | [IN] second key |
Definition at line 390 of file nfs_dupreq.c.
uint64_t dupreq_rbt_hash_func | ( | hash_parameter_t * | p_hparam, |
hash_buffer_t * | buffclef | ||
) |
dupreq_rbt_hash_func: computes the rbt value for the entry in dupreq cache.
Computes the rbt value for the entry in dupreq cache. In fact, it just use the Xid itself (which is an unsigned integer) as the rbt value. This function is called internal in the HasTable_* function
hparam | [IN] hash table parameter. |
buffcleff[in] | pointer to the hash key buffer |
Definition at line 365 of file nfs_dupreq.c.
uint32_t dupreq_value_hash_func | ( | hash_parameter_t * | p_hparam, |
hash_buffer_t * | buffclef | ||
) |
dupreq_rbt_hash_func: computes the hash value for the entry in dupreq cache.
Computes the hash value for the entry in dupreq cache. In fact, it just uses the xid modulo the hash array size.
This function is called internal in the HasTable_* function
hparam | [IN] hash table parameter. |
buffcleff[in] | pointer to the hash key buffer |
Definition at line 340 of file nfs_dupreq.c.
int nfs_dupreq_add_not_finished | ( | struct svc_req * | req, |
nfs_res_t * | res_nfs | ||
) |
nfs_dupreq_add_not_finished: adds an entry in the duplicate requests cache.
Adds an entry in the duplicate requests cache.
xid | [IN] the transfer id to be used as key |
pnfsreq | [IN] the request pointer to cache |
Definition at line 499 of file nfs_dupreq.c.
int nfs_dupreq_delete | ( | struct svc_req * | req | ) |
Definition at line 239 of file nfs_dupreq.c.
int nfs_dupreq_finish | ( | struct svc_req * | req, |
nfs_res_t * | p_res_nfs, | ||
LRU_list_t * | lru_dupreq | ||
) |
nfs_dupreq_finish: Changes the being_processed flag in a dupreq to 0 and adds the reply info to the buffval.
Changes the being_processed flag in a dupreq to 0 and adds the reply info to the buffval. Used after the duplicate request has already been added to the dupreq cache but has not been fully processed yet.
xid | [IN] the transfer id to be used as key |
pnfsreq | [IN] the request pointer to cache |
Definition at line 612 of file nfs_dupreq.c.
int nfs_dupreq_gc_function | ( | LRU_entry_t * | pentry, |
void * | addparam | ||
) |
nfs_dupreq_gc_function: Tests is an entry in dupreq cache is to be set invalid (has expired).
Tests is an entry in dupreq cache is to be set invalid (has expired).
pentry | [IN] pointer to the entry to test |
Definition at line 736 of file nfs_dupreq.c.
nfs_res_t nfs_dupreq_get | ( | struct svc_req * | req, |
int * | pstatus | ||
) |
nfs_dupreq_get: Tries to get a duplicated requests for dupreq cache
Tries to get a duplicated requests for dupreq cache.
req | [IN] svc_req whose xid we are looking for |
xprt | [IN] xprt the related xprt (but we could use req->rq_xprt) XXX |
pstatus | [OUT] the pointer to the status for the operation |
Definition at line 675 of file nfs_dupreq.c.
void nfs_dupreq_get_stats | ( | hash_stat_t * | phstat_udp, |
hash_stat_t * | phstat_tcp | ||
) |
nfs_dupreq_get_stats: gets the hash table statistics for the duplicate requests.
Gets the hash table statistics for the duplicate requests.
phstat | [OUT] pointer to the resulting stats. |
Definition at line 762 of file nfs_dupreq.c.
int print_entry_dupreq | ( | LRU_data_t | data, |
char * | str | ||
) |
print_entry_dupreq: prints an entry in the LRU list.
prints an entry in the LRU list.
data | [IN] data stored in a LRU entry to be printed. |
str | [OUT] string used to store the result. |
Definition at line 127 of file nfs_dupreq.c.